Ensure that the string we read from leftofffile is NULL
terminated; the buffer gets passed to strchr(), so
it's important that we ensure it ends with NULL.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fsrprintf(_("could not read %s, starting with %s\n"),
leftofffile, *fs->dev);
} else {
+ /* Ensure the buffer we read is null terminated */
+ buf[SMBUFSZ-1] = '\0';
for (fs = fsbase; fs < fsend; fs++) {
fsname = fs->dev;
if ((strncmp(buf,fsname,strlen(fsname)) == 0)