]> pd.if.org Git - pdclib/commitdiff
_PDCLIB_scan: Had incorrect upper bound on field width causing integer overflow
authorOwen Shepherd <owen.shepherd@e43.eu>
Wed, 26 Dec 2012 18:50:04 +0000 (18:50 +0000)
committerOwen Shepherd <owen.shepherd@e43.eu>
Wed, 26 Dec 2012 18:50:04 +0000 (18:50 +0000)
functions/_PDCLIB/scan.c

index 57f9831e457cd3dc918e4341befb2add07ced794..7e6c42c4c53c12e2d1e22e1a98b38b73508e05c1 100644 (file)
@@ -162,7 +162,7 @@ const char * _PDCLIB_scan( const char * spec, struct _PDCLIB_status_t * status )
     status->width = (int)strtol( spec, (char**)&spec, 10 );
     if ( spec == prev_spec )
     {
-        status->width = SIZE_MAX;
+        status->width = INT_MAX;
     }
 
     /* Optional length modifier