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

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