• Emanuele Aina's avatar
    pmap: Fix detail parsing on long mapping lines · 9965fdcb
    Emanuele Aina authored
    If the mapping descriptor is longer than 128 chars, the last parsed
    character won't be a newline even if the current buffer contains it a
    bit further than that. The current code always interprets it as a short
    fgets() read instead, and thus keeps calling fgets() until it gets a
    newline, dropping valid lines and failing with the following error:
    
    pmap: ERROR: inconsistent detail field in smaps file, line:
     Rss:                 212 kB
    9965fdcb
pmap.c 30.8 KB