• Alessandro Rubini's avatar
    bugfix: fru_strncpy was off by one, leading to rare memory corruptions · 0d1aca08
    Alessandro Rubini authored
    After correctly allocating the the manufacturer or device name,
    and correctly copying the not-null-terminated string from ipmi-fru,
    I put the termination '\0' at  string[len + 1] .
    
    If you build a recent kernel under slob (which is the default), it
    may fail miserably at unexpected places.  For example, if
    your string is 15 bytes, I allocated 16 but wrote to the 17th.
    slob has 16-byte alloc areas, and so I was corrupting the next area.
    
    This never happened with slab (which I prefer and run) because the smalles
    allocation chunk there is 32 bytes -- I would experience the same
    with a 31-long manufacturer or device name.
    Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    0d1aca08
Name
Last commit
Last update
..
include/linux Loading commit data...
.gitignore Loading commit data...
Makefile Loading commit data...
fmc-chardev.c Loading commit data...
fmc-core.c Loading commit data...
fmc-dump.c Loading commit data...
fmc-fakedev.c Loading commit data...
fmc-match.c Loading commit data...
fmc-sdb.c Loading commit data...
fmc-trivial.c Loading commit data...
fmc-write-eeprom.c Loading commit data...
fru-parse.c Loading commit data...