View Issue Details

IDProjectCategoryView StatusLast Update
0008012libmicrohttpdbuild systempublic2024-01-21 13:33
Reporterss Assigned ToChristian Grothoff  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionGit master 
Summary0008012: Build failure with LTO
DescriptionWhen LTO is enabled, linking fails complaining about potentially uninitialized variables; this patch fixes it (diff against 8bb481f commit):

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index f9892a55..e5dd1a45 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -653,7 +653,7 @@ MHD_connection_alloc_memory_ (struct MHD_Connection *connection,
 {
   struct MHD_Connection *const c = connection; /* a short alias */
   struct MemoryPool *const pool = c->pool; /* a short alias */
- size_t need_to_be_freed; /**< The required amount of additional free memory */
+ size_t need_to_be_freed = 0; /**< The required amount of additional free memory */
   void *res;
 
   res = MHD_pool_try_alloc (pool, size, &need_to_be_freed);
@@ -4468,7 +4468,7 @@ process_request_body (struct MHD_Connection *connection)
       { /* Need the parse the chunk size line */
         /** The number of found digits in the chunk size number */
         size_t num_dig;
- uint64_t chunk_size;
+ uint64_t chunk_size = 0;
         bool broken;
         bool overflow;
 
Steps To ReproduceHard to generate a minimal example reproducing this, but suggested patch is harmless - I hope you can apply it.
TagsNo tags attached.

Activities

Christian Grothoff

2024-01-21 13:29

manager   ~0020936

Fix committed to master branch.

Christian Grothoff

2024-01-21 13:30

manager   ~0020937

Should be fixed in 45aa83f1..32aa4d0d. (even though I could not reproduce, change seems harmless enough)

Related Changesets

libmicrohttpd: master 32aa4d0d

2024-01-21 13:29

Christian Grothoff


Details Diff
fix 0008012 Affected Issues
0008012
mod - src/microhttpd/connection.c Diff File

Issue History

Date Modified Username Field Change
2023-12-17 19:59 ss New Issue
2024-01-21 13:29 Christian Grothoff Changeset attached => libmicrohttpd master 32aa4d0d
2024-01-21 13:29 Christian Grothoff Note Added: 0020936
2024-01-21 13:29 Christian Grothoff Assigned To => Christian Grothoff
2024-01-21 13:29 Christian Grothoff Status new => resolved
2024-01-21 13:29 Christian Grothoff Resolution open => fixed
2024-01-21 13:30 Christian Grothoff Fixed in Version => 0.9.77
2024-01-21 13:30 Christian Grothoff Note Added: 0020937
2024-01-21 13:30 Christian Grothoff Product Version => Git master
2024-01-21 13:30 Christian Grothoff Target Version => 0.9.77
2024-01-21 13:33 Christian Grothoff Status resolved => closed