|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-12-10 05:17 UTC] lstrojny@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 21:00:01 2025 UTC |
Description: ------------ bug in: mogilefs.c lines 1307, 1356, 1405 comparison with string literal results in unspecified behavior Reproduce code: --------------- Compile with recent GCC versions. Expected result: ---------------- No code with unspecified behaviuor. Index: mogilefs.c =================================================================== --- mogilefs.c.orig 2008-12-09 17:44:39.000000000 +0100 +++ mogilefs.c 2008-12-10 00:44:23.000000000 +0100 @@ -1304,7 +1304,7 @@ PHP_METHOD(MogileFs, createClass) RETURN_FALSE; } - if (domain == NULL || domain == "\0" || strlen(domain) == 0) { + if (domain == NULL || (strcmp(domain,"\0") == 0) || strlen(domain) == 0) { domain = mogilefs_sock->domain; } @@ -1353,7 +1353,7 @@ PHP_METHOD(MogileFs, updateClass) RETURN_FALSE; } - if (domain == NULL || domain == "\0" || strlen(domain) == 0) { + if (domain == NULL || (strcmp(domain,"\0") == 0) || strlen(domain) == 0) { domain = mogilefs_sock->domain; } @@ -1402,7 +1402,7 @@ PHP_METHOD(MogileFs, deleteClass) RETURN_FALSE; } - if (domain == NULL || domain == "\0" || strlen(domain) == 0) { + if (domain == NULL || (strcmp(domain,"\0") == 0) || strlen(domain) == 0) { domain = mogilefs_sock->domain; } Actual result: -------------- -----