Skip to content

Segfault in mb_strrpos / mb_strripos when using negative offset and ASCII encoding #11217

Closed

Description

@rgeraads

Description

The following code:

<?php
var_dump(mb_strrpos('foo', 'foo', -1, 'ASCII'));
var_dump(mb_strripos('foo', 'foo', -1, 'ASCII'));

Resulted in this output:

Segmentation fault

But I expected this output instead:

bool(false)
bool(false)

https://3v4l.org/BlLRn

PHP Version

PHP 8.2.0

Operating System

No response

Activity

  1. self-assigned this
    on May 10, 2023
  2. added 2 commits that reference this issue on May 15, 2023
    aa553af
    c5a623b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions