[php-src] Issue #24956: [SECURITY] BUG-131: Memory Safety - strncpy() Without Null Termination
| From: | Codeleafly | Date: | Wed, 28 Oct 2026 01:51:40 +0000 |
| Subject: | [php-src] Issue #24956: [SECURITY] BUG-131: Memory Safety - strncpy() Without Null Termination | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-253411@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/24956
Author: Codeleafly
## 🐛 Security Bug Report
**Bug ID:** BUG-131
**Category:** Memory Safety
**Subcategory:** strncpy() Without Null Termination
**Severity:** Medium
**CWE:** CWE-170
**CVSS Score:** 5.0
**File:**
ext/standard/string.c
**Line:** multiple
**Status:** UNFIXED
**Verified:** False
### Description
strncpy() may not null-terminate destination if source length >= size. Subsequent string
operations read past buffer.
### Impact
Information disclosure, crash, potential code execution.
### Remediation
Always explicitly null-terminate after strncpy(): dest[size-1] = '\0'.
### Exploitability
Medium
### Source
- Repository: https://github.com/php/php-src/
- Branch: master
- Analysis Date: 2026-10-27T16:38:37.937347Z
---
*Auto-generated from static security analysis of php-src.*
*Total bugs found: 161*