Skip to content

Commit 2b9ff4a

Browse files
fix: V-001 security vulnerability
Automated security fix generated by Orbis Security AI
1 parent 6031497 commit 2b9ff4a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

main/streams/filter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ PHPAPI php_stream_bucket *php_stream_bucket_new(const php_stream *stream, char *
7575
if (is_persistent && !buf_persistent) {
7676
/* all data in a persistent bucket must also be persistent */
7777
bucket->buf = pemalloc(buflen, true);
78-
memcpy(bucket->buf, buf, buflen);
78+
if (EXPECTED(buflen > 0 && buf != NULL)) {
79+
memcpy(bucket->buf, buf, buflen);
80+
}
7981
bucket->buflen = buflen;
8082
bucket->own_buf = true;
8183
} else {

0 commit comments

Comments
 (0)