Preserve config string terminator when preparing key updates
This commit is contained in:
1 parent
39ce249361
commit
fa9e102271
1 file changed
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user