[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/29447] New: when gas/read.c calls mbstowcs with a NULL destinat
nicolas at debian dot org
[Bug gas/29447] New: when gas/read.c calls mbstowcs with a NULL destination, it should set size to 0
Thu, 04 Aug 2022 08:27:35 +0000
Bug ID: 29447
Summary: when gas/read.c calls mbstowcs with a NULL
destination, it should set size to 0
Assignee: unassigned at sourceware dot org
Reporter: nicolas at debian dot org
Target Milestone: ---
As described in bug 29265, glibc should not report an error when mbstowcs is
called with a NULL destination buffer and a non-zero size. Strictly speaking,
this alert is a false positive because the documentation for mbstowcs
explicitly mentions that the size argument is ignored when the buffer is NULL.
However, in the specific case of binutils/gas/read.c:1670, a value of 0 would
be more readable. The current version strongly suggests that the 'len'
variable is relevant.
@@ -1667,7 +1667,7 @@
/* Since quoted symbol names can contain non-ASCII characters,
check the string and warn if it cannot be recognised by the
current character set. */
- if (mbstowcs (NULL, name, len) == (size_t) -1)
+ if (mbstowcs (NULL, name, 0) == (size_t) -1)
as_warn (_("symbol name not recognised in the current locale"));
else if (is_name_beginner (c) || (input_from_string && c == FAKE_LABEL_CHAR)
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gas/29447] New: when gas/read.c calls mbstowcs with a NULL destination, it should set size to 0,
nicolas at debian dot org <=