[psaux] Correctly handle sequences of multiple number signs.

* src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed): Return zero
if we encounter more than a single sign.
This commit is contained in:
Werner Lemberg 2017-05-30 22:22:19 +02:00
parent f01463297f
commit 0e7b9f864f
2 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2017-05-30 Werner Lemberg <wl@gnu.org>
[psaux] Correctly handle sequences of multiple number signs.
* src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed): Return zero
if we encounter more than a single sign.
2017-05-29 Werner Lemberg <wl@gnu.org>
[pcf] 32bit integer overflow run-time errors (#46149).

View File

@ -111,6 +111,10 @@
p++;
if ( p == limit )
goto Bad;
/* only a single sign is allowed */
if ( *p == '-' || *p == '+' )
return 0;
}
num_limit = 0x7FFFFFFFL / base;
@ -215,6 +219,10 @@
p++;
if ( p == limit )
goto Bad;
/* only a single sign is allowed */
if ( *p == '-' || *p == '+' )
return 0;
}
/* read the integer part */