Bug #68671 [Com]: incorrect expression

From: Date: Mon, 29 Dec 2014 02:31:49 +0000
Subject: Bug #68671 [Com]: incorrect expression
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189293@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68671&edit=1 ID: 68671 Comment by: phpmpan at mpan dot pl Reported by: bugreports at internot dot info Summary: incorrect expression Status: Open Type: Bug Package: *General Issues Operating System: Linux Ubuntu 14.04 PHP Version: master-Git-2014-12-28 (Git) Block user comment: N Private report: N New Comment: The expression seems to be an attempt to silence the compiler which was pointing out a bug in the code, instead of fixing the bug. Introduced by commit cdc1a637. The bug is: 68 php_error_docref(NULL, E_NOTICE, "Warning: %s", expanded_format); 69 70 free(expanded_format); in both of these expressions expected_format may have undefined value. Additionally line 68 may be leaking memory contents to the client. Previous Comments: ------------------------------------------------------------------------ [2014-12-28 22:43:01] bugreports at internot dot info Description: ------------ Hi, In /ext/fileinfo/libmagic/print.c: 65 if (vasprintf(&expanded_format, f, va)); /* silence */ 66 va_end(va); I believe line 65 is incorrect. Why is there an if() aroudn it, then is ended by a semi-colon? Thanks ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68671&edit=1

« previous php.bugs (#189293) next »