Re: [PATCH] stdio-common: Remove do … while condition from printf_positional
Florian Weimer <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.alpha |
|---|---|
| Message-ID | <[email protected]> |
* Florian Weimer: > The condition is misleading because it is never evaluated. > > --- > stdio-common/vfprintf-internal.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/stdio-common/vfprintf-internal.c b/stdio-common/vfprintf-internal.c > index 14ac0d9762..a3bf411520 100644 > --- a/stdio-common/vfprintf-internal.c > +++ b/stdio-common/vfprintf-internal.c > @@ -1415,7 +1415,8 @@ printf_positional (struct Xprintf_buffer * buf, const CHAR_T *format, > } > break; > } > - while (Xprintf_buffer_has_failed (buf)); > + /* Used to make the break statements above work. */ > + while (0); > > /* Write the following constant string. */ > Xprintf_buffer_write (buf, > > base-commit: 9d7d6480880064cb5219aa267894ffabd0c2b20c I should have written: Found by AISLE in partnership with Red Hat. The tool assigned a score of CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - 5.0 (MEDIUM), but of course it's still dead code, so as a vulnerability report, it's bogus. Thanks, Florian