Browse Source

Preserve config string terminator when preparing key updates

proxy
evgeny 3 days ago
parent
commit
fa9e102271
  1. 2
      src/config_updater.c

2
src/config_updater.c

@ -479,7 +479,7 @@ int config_ensure_keys_and_node_id(const char *filename) {
buf_capacity = file_size + 1024;
work_buf = u_malloc(buf_capacity);
if (!work_buf) { u_free(file_buf); return -1; }
memcpy(work_buf, file_buf, file_size);
memcpy(work_buf, file_buf, file_size + 1); /* Helpers use strchr; preserve the terminating NUL. */
work_len = file_size;
u_free(file_buf); file_buf = NULL;
}

Loading…
Cancel
Save