this commit adds CVE-2016-6252.patch taken commit 1d5a926cc2d6078d23a96222b1ef3e558724dad1 which fixes the corresponding security issue. Closes: #5822 [via git-merge-pr]
28 lines
566 B
Diff
28 lines
566 B
Diff
--- lib/getulong.c
|
|
+++ lib/getulong.c
|
|
@@ -44,22 +44,19 @@
|
|
*/
|
|
int getulong (const char *numstr, /*@out@*/unsigned long int *result)
|
|
{
|
|
- long long int val;
|
|
+ unsigned long int val;
|
|
char *endptr;
|
|
|
|
errno = 0;
|
|
- val = strtoll (numstr, &endptr, 0);
|
|
+ val = strtoul (numstr, &endptr, 0);
|
|
if ( ('\0' == *numstr)
|
|
|| ('\0' != *endptr)
|
|
|| (ERANGE == errno)
|
|
- /*@+ignoresigns@*/
|
|
- || (val != (unsigned long int)val)
|
|
- /*@=ignoresigns@*/
|
|
) {
|
|
return 0;
|
|
}
|
|
|
|
- *result = (unsigned long int)val;
|
|
+ *result = val;
|
|
return 1;
|
|
}
|
|
|