Bug #80366 [Opn]: Potential issue in ext/standard/iptc.c: Return Value Not Checked
| From: | levim@php.net | Date: | Fri, 13 Nov 2020 19:23:24 +0000 |
| Subject: | Bug #80366 [Opn]: Potential issue in ext/standard/iptc.c: Return Value Not Checked | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230350@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80366&edit=1
ID: 80366
Updated by: levim@php.net
Reported by: sagpant at microsoft dot com
Summary: Potential issue in ext/standard/iptc.c: Return Value
Not Checked
Status: Open
Type: Bug
Package: *General Issues
PHP Version: 7.4.12
Block user comment: N
Private report: N
New Comment:
Nits on the patch:
I prefer
== 0 over != 1.
The nested if is unnecessary; combine it with the surrounding if.
Previous Comments:
------------------------------------------------------------------------
[2020-11-13 19:12:54] sagpant at microsoft dot com
Description:
------------
In this codebase, you often check the return value of the implicated function when calling it, but
at this instance, it appears that you didnât. Using a consistent return value checking and/or
error handling approach can improve code robustness and readability.
File: PHP-7.4.12/ext/standard/iptc.c
Line Number: 220
Function: zend_fstat
Correct reference usage found in main/streams/plain_wrapper.c line: 160
Test script:
---------------
Analyzer points out inconsistencies in the code.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80366&edit=1