php.net |  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
40 - 9 = ?
Subscribe to this entry?

 
 [2018-02-08 17:12 UTC] sed dot baddou at gmail dot com
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-08 17:54 UTC] stas@php.net
-Package: PHP Language Specification +Package: Strings related
 [2018-02-09 13:40 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2018-02-09 13:40 UTC] ab@php.net
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.

Thanks.
 [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: Wed Apr 24 21:01:29 2024 UTC