Bug #74400 [Opn->Csd]: Suspicious function adress usage
| From: | krakjoe@php.net | Date: | Mon, 10 Apr 2017 07:07:11 +0000 |
| Subject: | Bug #74400 [Opn->Csd]: Suspicious function adress usage | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208415@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74400&edit=1
ID: 74400
Updated by: krakjoe@php.net
Reported by: appchecker at cnpo dot ru
Summary: Suspicious function adress usage
-Status: Open
+Status: Closed
Type: Bug
Package: *General Issues
PHP Version: 7.1.4RC1
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=60b68f19f0618c884b9d97da79bd0b5c06c35072
Log: Fixed bug #74400 (phpdbg comparing socket function to int)
Previous Comments:
------------------------------------------------------------------------
[2017-04-10 07:01:06] appchecker at cnpo dot ru
Description:
------------
Hello!
We've checked your code with AppChecker static analyzer and found possible bug:
https://github.com/php/php-src/blob/e0f68ae1441bac063e2a72b980f1ddfee596ea25/sapi/phpdbg/phpdbg_io.c#L352
PHPDBG_API void phpdbg_close_socket(int sock) {
if (socket >= 0) {
#ifdef _WIN32
closesocket(sock);
#else
shutdown(sock, SHUT_RDWR);
close(sock);
#endif
}
}
socket is a function. It seems suspicious to compare pointer with '0'. Maybe variable sock
must be used instead?
Possible defect was found by Echelon Team with [AppChecker static
analyzer](https://cnpo.ru/en/solutions/appchecker.php)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74400&edit=1