|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75936 Strpos offset of type long and haystack len of type int
Submitted: 2018-02-08 17:12 UTC Modified: 2018-06-24 04:25 UTC
From: sed dot baddou at gmail dot com Assigned:
Status: No Feedback Package: Strings related
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: sed dot baddou at gmail dot com
New email:
PHP Version: OS:


 [2018-02-08 17:12 UTC] sed dot baddou at gmail dot com
While I was reading strpos source code, I stumbeled across multiple versions where haystack_len is declared as int, while offset is long, correct me if i'm wrong but if haystack len exceeds intmax value wont it underflow and give incorrect values.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-08 17:54 UTC]
-Package: PHP Language Specification +Package: Strings related
 [2018-02-09 13:40 UTC]
-Status: Open +Status: Feedback
 [2018-02-09 13:40 UTC]
Thanks for the report. Please link to the places you've found. Note - it is a won't fix in PHP 5, need to check thoroughly in PHP 7.

 [2018-06-24 04:25 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 20:01:28 2024 UTC