|   | 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 Group All rights reserved. | Last updated: Fri Oct 31 02:00:02 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: -------------- -----