opcache: change uses of sprintf into snprintf

This commit is contained in:
Niels Dossche 2024-06-09 19:40:21 +02:00
parent 26fcb5f2b2
commit a4674654ab
2 changed files with 2 additions and 2 deletions

View file

@ -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);
}
}

View file

@ -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);