Bug #68671 [Asn->Csd]: incorrect expression
| From: | ab@php.net | Date: | Tue, 30 Dec 2014 18:41:40 +0000 |
| Subject: | Bug #68671 [Asn->Csd]: incorrect expression | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-189541@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
Updated by: ab@php.net
Reported by: bugreports at internot dot info
Summary: incorrect expression
-Status: Assigned
+Status: Closed
Type: Bug
Package: Filesystem function related
Operating System: Linux Ubuntu 14.04
PHP Version: master-Git-2014-12-28 (Git)
Assigned To: ab
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d92a87d7cb81f94b8705cdbeaa1b3836dc145549
Log: Fixed bug #68671 incorrect expression in libmagic
Previous Comments:
------------------------------------------------------------------------
[2014-12-30 02:59:49] aharvey@php.net
Anatol, can you have a look at this, please? It appears to be related to your fix for bug #64713.
------------------------------------------------------------------------
[2014-12-29 02:31:48] phpmpan at mpan dot pl
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.
------------------------------------------------------------------------
[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