php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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
Status: Closed Package: *General Issues
PHP Version: master-Git-2015-01-01 (Git) OS: Linux Ubuntu 14.04
Private report: No CVE-ID:
 [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)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-08 08:38 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1b4f7c3a771f2bae365190fa4f5d4b9b8aa4cae5
Log: Fixed #68711
 [2015-01-08 08:38 UTC] laruence@php.net
-Status: Open +Status: Closed
 [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:44 UTC] mj@php.net
The following patch has been added/updated:

Patch Name: 68711-flatfile-joshua-rogers
Revision:   1421480645
URL:        https://bugs.php.net/patch-display.php?bug=68711&patch=68711-flatfile-joshua-rogers&revision=1421480645
 [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
Automatic comment on behalf of git@internot.info
Revision: http://git.php.net/?p=php-src.git;a=commit;h=df67c4e8bd0c7c0f1fc976fad7f6fe5cbc01ef9b
Log: Fix bug #68711 Remove useless checks. 'num' is unsigned and cannot be &lt;0.
 [2015-01-20 14:12 UTC] jpauli@php.net
-Status: Assigned +Status: Closed
 [2015-01-20 14:13 UTC] jpauli@php.net
Automatic comment on behalf of git@internot.info
Revision: http://git.php.net/?p=php-src.git;a=commit;h=df67c4e8bd0c7c0f1fc976fad7f6fe5cbc01ef9b
Log: Fix bug #68711 Remove useless checks. 'num' is unsigned and cannot be &lt;0.
 [2015-01-20 14:13 UTC] jpauli@php.net
Automatic comment on behalf of git@internot.info
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c9b25859f0dcf451321ba4bca6c406fd84eab2a6
Log: Fix bug #68711 Remove useless checks. 'num' is unsigned and cannot be &lt;0.
 [2015-01-20 14:14 UTC] jpauli@php.net
-Assigned To: +Assigned To: jpauli
 [2015-01-20 14:14 UTC] jpauli@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2015-01-20 18:42 UTC] stas@php.net
Automatic comment on behalf of git@internot.info
Revision: http://git.php.net/?p=php-src.git;a=commit;h=df67c4e8bd0c7c0f1fc976fad7f6fe5cbc01ef9b
Log: Fix bug #68711 Remove useless checks. 'num' is unsigned and cannot be &lt;0.
 [2016-07-20 11:39 UTC] davey@php.net
Automatic comment on behalf of git@internot.info
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c9b25859f0dcf451321ba4bca6c406fd84eab2a6
Log: Fix bug #68711 Remove useless checks. 'num' is unsigned and cannot be &lt;0.
 [2016-07-20 11:40 UTC] davey@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1b4f7c3a771f2bae365190fa4f5d4b9b8aa4cae5
Log: Fixed #68711
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Apr 30 01:01:34 2017 UTC