diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 746cfe27163..77ea8be2027 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -16121,7 +16121,7 @@ static const void *zend_jit_trace_allocate_exit_group(uint32_t n) char name[32]; for (i = 0; i < ZEND_JIT_EXIT_POINTS_PER_GROUP; i++) { - sprintf(name, "jit$$trace_exit_%d", n + i); + snprintf(name, sizeof(name), "jit$$trace_exit_%d", n + i); ir_disasm_add_symbol(name, (uintptr_t)entry + (i * ZEND_JIT_EXIT_POINTS_SPACING), ZEND_JIT_EXIT_POINTS_SPACING); } } diff --git a/ext/opcache/shared_alloc_posix.c b/ext/opcache/shared_alloc_posix.c index 8560ac03770..3f1e097fe97 100644 --- a/ext/opcache/shared_alloc_posix.c +++ b/ext/opcache/shared_alloc_posix.c @@ -77,7 +77,7 @@ static int create_segments(size_t requested_size, zend_shared_segment_posix ***s shared_segment = (zend_shared_segment_posix *)((char *)(*shared_segments_p) + sizeof(void *)); (*shared_segments_p)[0] = shared_segment; - sprintf(shared_segment_name, "/ZendAccelerator.%d", getpid()); + snprintf(shared_segment_name, sizeof(shared_segment_name), "/ZendAccelerator.%d", getpid()); #if defined(HAVE_SHM_CREATE_LARGEPAGE) if (shared_segment_lg_index > 0) { shared_segment->shm_fd = shm_create_largepage(shared_segment_name, shared_segment_flags, shared_segment_lg_index, SHM_LARGEPAGE_ALLOC_DEFAULT, shared_segment_mode);