mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
coverity 83659 plat unix check fstat return
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
956a08a9c0
commit
24109f40ae
1 changed files with 4 additions and 1 deletions
|
@ -423,7 +423,10 @@ lws_plat_open_file(const char* filename, unsigned long* filelen)
|
|||
if (ret < 0)
|
||||
return LWS_INVALID_FILE;
|
||||
|
||||
fstat(ret, &stat_buf);
|
||||
if (fstat(ret, &stat_buf) < 0) {
|
||||
close(ret);
|
||||
return LWS_INVALID_FILE;
|
||||
}
|
||||
*filelen = stat_buf.st_size;
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue