[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a warning in ios-dev-stream.c

From: Bruno Haible
Subject: a warning in ios-dev-stream.c
Date: Sat, 20 Feb 2021 02:30:57 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-201-generic; KDE/5.18.0; x86_64; ; )

Gcc gives me a warning:

ios-dev-stream.c: In function 'ios_dev_stream_pread':
ios-dev-stream.c:184:7: warning: ignoring return value of 'fread', declared 
with attribute warn_unused_result [-Wunused-result]
       fread (temp, to_be_read, 1, sio->file);

I think the warning is justified: If someone truncates the file just before
the fread() call happens, fread() will read nothing, and the following
ios_buffer_pwrite() call will write an uninitialized value?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]