Bash-5.3 patch 13: fix technically undefined behavior when comparing return value from realloc to the original pointer

This commit is contained in:
Chet Ramey
2026-06-10 08:56:30 -04:00
parent ecb2456d63
commit 427d51d84d
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -788,8 +788,11 @@ read_builtin (WORD_LIST *list)
char *x;
x = (char *)xrealloc (input_string, size += 128);
/* Only need to change unwind-protect if input_string changes */
#if 0
/* This is, in theory, undefined behavior, since input_string may
have been freed. */
if (x != input_string)
#endif
{
input_string = x;
remove_unwind_protect ();
+1 -1
View File
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
#define PATCHLEVEL 12
#define PATCHLEVEL 13
#endif /* _PATCHLEVEL_H_ */