Follow-up Comment #1, bug #59881 (project make):

This makefile causes variable_buffer_output to realloc. This renders buffer in
enter_prereqs invalid.

Here is a patch.

diff --git a/src/file.c b/src/file.c
index a979ca5..61f0a56 100644
--- a/src/file.c
+++ b/src/file.c
@@ -524,8 +524,12 @@ enter_prereqs (struct dep *deps, const char *stem)
                   continue;
                 }

-              /* Save the name.  */
-              dp->name = strcache_add_len (buffer, o - buffer);
+              /* Save the name.
+               * VARIABLE_BUFFER_OUTPUT could realloc, which'd render BUFFER
+               * invalid.
+               * sv 59881.  */
+              dp->name = strcache_add_len (variable_buffer,
+                                           o - variable_buffer);
             }
           dp->stem = stem;
           dp->staticpattern = 1;


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59881>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/


Reply via email to