projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
94ae606
)
demand_copy_C_string NUL check
author
Alan Modra
<amodra@gmail.com>
Tue, 16 Feb 2021 04:02:36 +0000
(14:32 +1030)
committer
Alan Modra
<amodra@gmail.com>
Tue, 16 Feb 2021 04:10:14 +0000
(14:40 +1030)
* read.c (demand_copy_C_string): Really check for embedded zeros.
gas/ChangeLog
patch
|
blob
|
history
gas/read.c
patch
|
blob
|
history
diff --git
a/gas/ChangeLog
b/gas/ChangeLog
index 9c6fe109d92ec64995d07db2aa668a8225271b34..f4c9d0a0fa60f67e2e75157b711621039b1bdf6a 100644
(file)
--- a/
gas/ChangeLog
+++ b/
gas/ChangeLog
@@
-1,3
+1,7
@@
+2021-02-16 Alan Modra <amodra@gmail.com>
+
+ * read.c (demand_copy_C_string): Really check for embedded zeros.
+
2021-02-15 Andreas Krebbel <krebbel@linux.ibm.com>
* config/tc-s390.c (s390_parse_cpu): New entry for arch14.
diff --git
a/gas/read.c
b/gas/read.c
index ede811b0a0337c6f3199dc89d825824f2cafcf3b..3e76065328954d203bdc7e2308813545792dd12b 100644
(file)
--- a/
gas/read.c
+++ b/
gas/read.c
@@
-5743,12
+5743,12
@@
demand_copy_C_string (int *len_pointer)
for (len = *len_pointer; len > 0; len--)
{
- if (
*s
== 0)
+ if (
s[len - 1]
== 0)
{
s = 0;
- len = 1;
*len_pointer = 0;
as_bad (_("this string may not contain \'\\0\'"));
+ break;
}
}
}