handle weird cases where 0 is listed in /proc/n/maps
This commit is contained in:
@@ -115,8 +115,15 @@ static int get_readable_ranges( const void **starts, const void **ends, int size
|
|||||||
if( strlen(space) < 4 || space[3] != 'x' )
|
if( strlen(space) < 4 || space[3] != 'x' )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
*starts++ = (const void *) xtoi( line );
|
/* If, for some reason, either end is NULL, skip it; that's our terminator. */
|
||||||
*ends++ = (const void *) xtoi( hyphen+1 );
|
const void *start = (const void *) xtoi( line );
|
||||||
|
const void *end = (const void *) xtoi( hyphen+1 );
|
||||||
|
if( start != NULL && end != NULL )
|
||||||
|
{
|
||||||
|
*starts++ = start;
|
||||||
|
*ends++ = end;
|
||||||
|
}
|
||||||
|
|
||||||
++got;
|
++got;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user