summaryrefslogtreecommitdiff
path: root/src/modules/m_httpd.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-09-23 02:51:16 +0200
committerattilamolnar <attilamolnar@hush.com>2012-09-23 03:16:58 +0200
commit83c7cc45daf6fb1f8c36f15297a4657e45a34e88 (patch)
treec29ad7d8623eb7789c39c519de19ee414db2a95e /src/modules/m_httpd.cpp
parentcff57f7ba780a5c4fc331ccbab489abdc572379c (diff)
Fix undefined behavior caused by referencing the returned buffer by std::string::c_str() when the object is temporary
Thanks to @ChrisTX for pointing this out Fixes #257 reported by @helloall
Diffstat (limited to 'src/modules/m_httpd.cpp')
-rw-r--r--src/modules/m_httpd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index 0584e97c5..bf86c9091 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -282,7 +282,7 @@ class HttpServerSocket : public BufferedSocket
return;
}
- if (headers.IsSet("Content-Length") && (postsize = atoi(headers.GetHeader("Content-Length").c_str())) != 0)
+ if (headers.IsSet("Content-Length") && (postsize = ConvToInt(headers.GetHeader("Content-Length"))) != 0)
{
InternalState = HTTP_SERVE_RECV_POSTDATA;