[PATCH] testsuites/fstests: Fix uninitialized utimbuf structs

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Sep 7 05:36:15 UTC 2021


On 07/09/2021 05:47, Alex White wrote:
> The utimbuf structs in fsimfsconfig01 and fsimfsconfig02 were
> being passed to utime uninitialized. This did not cause problems until
> utime was changed to use utimensat behind the scenes. Now that
> utimensat is called, the values of the utimbuf struct are checked, and
> EINVAL is set for invalid values. The utimebuf structs in these tests
> could contain invalid values since they are uninitialized.
> 
> By zero-initializing the utimbuf structs, we ensure that they pass the
> checks in utimensat and that errno is set to the expected ENOTSUP.

Looks good, maybe make the structures "const" to check also that the 
utime() prototype uses a const parameter.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list