[php-src] Issue #24958: [SECURITY] BUG-133: Memory Safety - strncpy() Without Null Termination

From: Date: Wed, 28 Oct 2026 01:51:42 +0000
Subject: [php-src] Issue #24958: [SECURITY] BUG-133: Memory Safety - strncpy() Without Null Termination
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-253412@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/24958 Author: Codeleafly ## 🐛 Security Bug Report **Bug ID:** BUG-133 **Category:** Memory Safety **Subcategory:** strncpy() Without Null Termination **Severity:** Medium **CWE:** CWE-170 **CVSS Score:** 5.0 **File:** ext/standard/array.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*

« previous php.bugs (#253412) next »