|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79225 Risk of integer overflow in logical_filters.c
Submitted: 2020-02-04 14:44 UTC Modified: 2020-02-05 17:00 UTC
From: geeknik at protonmail dot ch Assigned:
Status: Not a bug Package: Filter related
PHP Version: 7.4Git-2020-02-04 (Git) OS: Ubuntu
Private report: No CVE-ID: None
 [2020-02-04 14:44 UTC] geeknik at protonmail dot ch
Line 117 of logical_filters.c looks like so:

ctx_value = ((sign)?-1:1) * ((*(str++)) - '0');

It may be possible to overflow this 'int' before it is converted to 'zend_long'. Please tell me what you think.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-02-04 17:56 UTC]
> It may be possible to overflow this 'int' […]

How so?  It seems to me that the right-hand factor of the
multiplication[1] evaluates to 1..9.

[1] <>
 [2020-02-05 17:00 UTC]
-Status: Open +Status: Not a bug -Type: Security +Type: Bug
 [2020-02-05 17:00 UTC]
That's correct, there can be no overflow here.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 19:01:29 2024 UTC