diff options
author | Alan Modra <amodra@gmail.com> | 2024-12-26 07:19:24 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2024-12-26 07:31:24 +1030 |
commit | 6d9b7667974372357fed1f02c54a805f8c21dcde (patch) | |
tree | 82818dc287455c00c3636de5c8567bd65f76fc01 | |
parent | 578c704c8eb0f376315056bde431c4403facd5e5 (diff) | |
download | binutils-6d9b7667974372357fed1f02c54a805f8c21dcde.zip binutils-6d9b7667974372357fed1f02c54a805f8c21dcde.tar.gz binutils-6d9b7667974372357fed1f02c54a805f8c21dcde.tar.bz2 |
macro.c:871 heap-buffer-overflow
PR 32391 commit 9f2e3c21f6 fallout again. Also fix another 'macro'
may be used uninitialized.
-rw-r--r-- | gas/macro.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/macro.c b/gas/macro.c index 3d5a9f1..ded0645 100644 --- a/gas/macro.c +++ b/gas/macro.c @@ -868,7 +868,7 @@ sub_actual (size_t start, sb *in, sb *t, struct htab *formal_hash, /* The parent's FORMALs might contain parameters that need further substitution. See gas/testsuite/gas/arm/macro-vld1.s for an example of this. */ - if (strchr (add->ptr, '\\')) + if (memchr (add->ptr, '\\', add->len)) { sb newadd; @@ -1485,7 +1485,7 @@ delete_macro (const char *name) } } - if (macro == NULL) + if (j < 0) as_warn (_("Attempt to purge non-existing macro `%s'"), copy); free (copy); |