Skip to content

Commit a467465

Browse files
committed
opcache: change uses of sprintf into snprintf
1 parent 26fcb5f commit a467465

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/opcache/jit/zend_jit_ir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16121,7 +16121,7 @@ static const void *zend_jit_trace_allocate_exit_group(uint32_t n)
1612116121
char name[32];
1612216122

1612316123
for (i = 0; i < ZEND_JIT_EXIT_POINTS_PER_GROUP; i++) {
16124-
sprintf(name, "jit$$trace_exit_%d", n + i);
16124+
snprintf(name, sizeof(name), "jit$$trace_exit_%d", n + i);
1612516125
ir_disasm_add_symbol(name, (uintptr_t)entry + (i * ZEND_JIT_EXIT_POINTS_SPACING), ZEND_JIT_EXIT_POINTS_SPACING);
1612616126
}
1612716127
}

ext/opcache/shared_alloc_posix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static int create_segments(size_t requested_size, zend_shared_segment_posix ***s
7777
shared_segment = (zend_shared_segment_posix *)((char *)(*shared_segments_p) + sizeof(void *));
7878
(*shared_segments_p)[0] = shared_segment;
7979

80-
sprintf(shared_segment_name, "/ZendAccelerator.%d", getpid());
80+
snprintf(shared_segment_name, sizeof(shared_segment_name), "/ZendAccelerator.%d", getpid());
8181
#if defined(HAVE_SHM_CREATE_LARGEPAGE)
8282
if (shared_segment_lg_index > 0) {
8383
shared_segment->shm_fd = shm_create_largepage(shared_segment_name, shared_segment_flags, shared_segment_lg_index, SHM_LARGEPAGE_ALLOC_DEFAULT, shared_segment_mode);

0 commit comments

Comments
 (0)