[LTP] [PATCH] mmap01: initialize buffer in check_file()
Cyril Hrubis
chrubis@suse.cz
Wed Jan 22 12:01:42 CET 2025
Hi!
> > mmap01 reported random test failures. Turns out the
> > the temporary buffer in check_file() isn't initialized.
> > The SAFE_READ reads less then sizeof(buf) bytes so the
> > rest stays initialized and might contain bytes check_file()
> > is looking for.
>
> Looks reasonable to me.
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
> @Cyril a candidate for merge before the release.
Alternatively we could use the return value from the SAFE_READ() instead
of the buf_len. Also I suppose that we could check that we read at least
something.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list