PHP :: Bug #68712 :: suspicious if-else statements

Bug #68712 suspicious if-else statements
Submitted: 2015-01-02 07:28 UTC Modified: 2016-07-23 17:32 UTC
From: bugreports at internot dot info Assigned: cmb (profile)
Status: Closed Package: GD related
PHP Version: master-Git-2015-01-02 (Git) OS: Linux Ubuntu 14.04
Private report: No CVE-ID: None

 [2015-01-02 07:28 UTC] bugreports at internot dot info

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

in /ext/gd/libgd/gd_interpolation.c:

1539                        if (m >= src_h - 2) {
1540                                src_offset_x[13] = n;
1541                                src_offset_y[13] = m;
1542                        } else {
1543                                src_offset_x[13] = n;
1544                                src_offset_y[13] = m;
1545                        }


and

1946                                if (m < 1) {
1947                                        src_offset_x[1] = n;
1948                                        src_offset_y[1] = m;
1949                                } else {
1950                                        src_offset_x[1] = n;
1951                                        src_offset_y[1] = m ;
1952                                }



In each, each possiblity is the same. Is this intended?


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2016-07-23 17:15 UTC] cmb@php.net

-Summary: identical code +Summary: superfluous if-else statements

 [2016-07-23 17:32 UTC] cmb@php.net

-Summary: superfluous if-else statements +Summary: suspicious if-else statements -Status: Assigned +Status: Verified -Assigned To: pajoye +Assigned To: cmb

 [2016-07-23 17:32 UTC] cmb@php.net

> In each, each possiblity is the same. Is this intended?

Comparing with external libgd, it is indeed. Therefore the
if-statements are superfluous and should be removed to avoid
confusion.

 [2016-07-23 17:51 UTC] cmb@php.net

-Status: Verified +Status: Closed