diff --git a/checkin_notes b/checkin_notes index 5d167e79df..db916ce359 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8290,3 +8290,12 @@ David 10 Oct 2008 client/ app.cpp client_types.cpp + +David 10 Oct 2008 + - client: correctly null-terminate file upload handler reply + - web: fix typo + + client/ + http_curl.cpp + html/user/ + forum_post.php diff --git a/client/http_curl.cpp b/client/http_curl.cpp index 0d798bed5f..6260fed679 100644 --- a/client/http_curl.cpp +++ b/client/http_curl.cpp @@ -1065,8 +1065,8 @@ void HTTP_OP::handle_messages(CURLMsg *pcurlMsg) { ); } else { strcpy(req1, ""); - if (dSize > (size_t)req1_len) { - dSize = req1_len; + if (dSize >= (size_t)req1_len) { + dSize = req1_len-1; } size_t nread = fread(req1, 1, dSize, fileOut); if (nread != dSize) { @@ -1077,7 +1077,7 @@ void HTTP_OP::handle_messages(CURLMsg *pcurlMsg) { ); } } - req1[req1_len-1] = 0; // make sure null-terminated + req1[nread] = 0; } } diff --git a/html/user/forum_post.php b/html/user/forum_post.php index 3928344e82..6fc168bea8 100644 --- a/html/user/forum_post.php +++ b/html/user/forum_post.php @@ -50,7 +50,7 @@ if ($content && $title && (!$preview)){ $warning = "Your message was flagged as spam by the Akismet anti-spam system. Please modify your text and try again. "; - preview = tra("Preview"); + $preview = tra("Preview"); } else { $thread = create_thread( $title, $content, $logged_in_user, $forum, $add_signature