Skip to content

zend_memnstr: Assertion `end >= p' failed. #23106

Description

@lmaltsis

Description

The following code:

<?
mb_strpos("AA\xf0\x90", "xyz", 3);

Resulted in this output:

php: src/Zend/zend_operators.h:197: zend_memnstr: Assertion `end >= p' failed.
Aborted (core dumped)

PHP Version

PHP 8.5.9 (cli) (built: Aug  7 2026 18:15:17) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.5.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.9, Copyright (c), by Zend Technologies

also triggers on trunk

Operating System

Ubuntu 24.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions