Skip to content

Commit 8901082

Browse files
authored
webserver: Fix garbage output on debug print (etr#244)
The `upload_data` we get in the callback from libmicrohttpd might not be null terminated. Fixes: etr#242 Signed-off-by: Alexander Dahl <ada@thorsis.com>
1 parent 263f2bd commit 8901082

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/webserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ MHD_Result webserver::requests_answer_second_step(MHD_Connection* connection, co
525525

526526
if (mr->has_body) {
527527
#ifdef DEBUG
528-
std::cout << "Writing content: " << upload_data << std::endl;
528+
std::cout << "Writing content: " << std::string(upload_data, *upload_data_size) << std::endl;
529529
#endif // DEBUG
530530
mr->dhr->grow_content(upload_data, *upload_data_size);
531531

0 commit comments

Comments
 (0)