strcspn stops on null character
| Bug #39032 | strcspn stops on null character | ||||
|---|---|---|---|---|---|
| Submitted: | 2006-10-04 08:37 UTC | Modified: | 2006-10-04 11:15 UTC | ||
| From: | tstarling at wikimedia dot org | Assigned: | |||
| Status: | Closed | Package: | Strings related | ||
| PHP Version: | 5.1.6 | OS: | Linux | ||
| Private report: | No | CVE-ID: | None | ||
[2006-10-04 08:37 UTC] tstarling at wikimedia dot org
Description: ------------ strcspn() incorrectly stops on null characters, as if the function was implemented with null-terminated strings. Confirmed on PHP 5.1.6-pl4-gentoo (cli), PHP 5.1.4 Windows NT mod_php, PHP 5.1.4 FC4 cli. Reproduce code: --------------- print strcspn(chr(0),"x").", ".strcspn(chr(1),"x")."\n" Expected result: ---------------- 1, 1 Actual result: -------------- 0, 1
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2006-10-04 11:15 UTC] tony2001@php.net