diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-16 22:49:22 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-16 22:49:22 +0300 |
commit | 0e51cec3d2d8b91d4d79379f691b53c2a0c76ec6 (patch) | |
tree | 97c6b285512fb9f5717106c8c8da387db404cc78 /plugins/Weather/src/weather_http.cpp | |
parent | 94141d449c0db6b8ea249e859eebdd69123d1029 (diff) |
fix for buffer overrun
Diffstat (limited to 'plugins/Weather/src/weather_http.cpp')
-rw-r--r-- | plugins/Weather/src/weather_http.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/Weather/src/weather_http.cpp b/plugins/Weather/src/weather_http.cpp index 1209648d64..63ea78b03a 100644 --- a/plugins/Weather/src/weather_http.cpp +++ b/plugins/Weather/src/weather_http.cpp @@ -136,9 +136,9 @@ int InternetDownloadFile(char *szUrl, char *cookie, char *userAgent, wchar_t **s }
// return error code if the recieved code is neither 200 OK nor 302 Moved
else {
- *szData = (wchar_t*)mir_alloc(512);
// store the error code in szData
- mir_snwprintf(*szData, 512, L"Error occured! HTTP Error: %i\n", nlhrReply->resultCode);
+ CMStringW wszError(FORMAT, L"Error occured! HTTP Error: %i\n", nlhrReply->resultCode);
+ *szData = wszError.Detach();
result = nlhrReply->resultCode;
}
|