[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #59881] Segmentation Fault through manipulated Makefile
From: |
Dmitry Goncharov |
Subject: |
[bug #59881] Segmentation Fault through manipulated Makefile |
Date: |
Sun, 17 Jan 2021 21:36:04 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 |
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/