aboutsummaryrefslogtreecommitdiff
path: root/gas/expr.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-03-17 11:54:40 +1030
committerAlan Modra <amodra@gmail.com>2022-03-17 21:32:44 +1030
commit0d1064face9956be43774b81e9cdad5daea28c92 (patch)
treeca43519e91660955464296ab9b48145c2613237b /gas/expr.c
parentdf573325cb23198af194a492842f957f8b6945b4 (diff)
downloadbinutils-0d1064face9956be43774b81e9cdad5daea28c92.zip
binutils-0d1064face9956be43774b81e9cdad5daea28c92.tar.gz
binutils-0d1064face9956be43774b81e9cdad5daea28c92.tar.bz2
asan: buffer overflows after calling ignore_rest_of_line
operand() is not a place that should be calling ignore_rest_of_line. ignore_rest_of_line shouldn't increment input_line_pointer if already at buffer limit. * expr.c (operand): Don't call ignore_rest_of_line. * read.c (s_mri_common): Likewise. (ignore_rest_of_line): Don't increment input_line_pointer if already at buffer_limit.
Diffstat (limited to 'gas/expr.c')
-rw-r--r--gas/expr.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gas/expr.c b/gas/expr.c
index bd5b9e7..2341343 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -1212,9 +1212,7 @@ operand (expressionS *expressionP, enum expr_mode mode)
{
as_bad (_("expected symbol name"));
(void) restore_line_pointer (c);
- if (c != ')')
- ignore_rest_of_line ();
- else
+ if (c == ')')
++input_line_pointer;
break;
}