summaryrefslogtreecommitdiff
path: root/plugins/Weather/src/weather_http.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-16 22:49:22 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-16 22:49:22 +0300
commit0e51cec3d2d8b91d4d79379f691b53c2a0c76ec6 (patch)
tree97c6b285512fb9f5717106c8c8da387db404cc78 /plugins/Weather/src/weather_http.cpp
parent94141d449c0db6b8ea249e859eebdd69123d1029 (diff)
fix for buffer overrun
Diffstat (limited to 'plugins/Weather/src/weather_http.cpp')
-rw-r--r--plugins/Weather/src/weather_http.cpp4
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;
}