PHP :: Request #68711 :: useless comparisons

Request #68711 useless comparisons
Submitted: 2015-01-02 00:34 UTC Modified: 2015-01-20 14:14 UTC
From: bugreports at internot dot info Assigned: jpauli (profile)
Status: Closed Package: *General Issues
PHP Version: master-Git-2015-01-01 (Git) OS: Linux Ubuntu 14.04
Private report: No CVE-ID: None

 [2015-01-02 00:34 UTC] bugreports at internot dot info

Description:
------------
Hi,

Multiple reports here:


/ext/standard/pack.c:
749                                                while (--len >= 0) {

len is unsigned, so it can never be <0




In /ext/dba/libflatfile/flatfile.c:

183                if (num < 0) {
num is unsigned
277                if (num < 0)  {
num is unsigned
129                if (num < 0)  {
num is unsigned
229                if (num < 0) {
num is unsigned



Thanks,


T


Patches

68711-flatfile-joshua-rogers (last revision 2015-01-17 07:44 UTC by mj@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2015-01-09 14:22 UTC] bugreports at internot dot info

Yes, that fixed the pack.c one, but not the flatfile.c one.

Thanks,

 [2015-01-14 18:29 UTC] bugreports at internot dot info

-Status: Closed +Status: Assigned

 [2015-01-14 18:29 UTC] bugreports at internot dot info

Re-opening due to mixing fix for /ext/dba/libflatfile/flatfile.c bug.

Thanks

 [2015-01-17 07:45 UTC] mj@php.net

The patch I've attached seconds ago has been posted to internals@ by Joshua Rogers on 2015-01-15.

 [2015-01-20 14:12 UTC] jpauli@php.net

-Status: Assigned +Status: Closed

 [2015-01-20 14:14 UTC] jpauli@php.net

-Assigned To: +Assigned To: jpauli