Skip to content

Commit aa90052

Browse files
authored
Merge pull request #2737 from vulgraph/backport/CVE-2024-10964-v2.9
[v2.9] Backport CVE-2024-10964: plugin: buffer overflow in library strcpy
2 parents 72cab4a + 2824197 commit aa90052

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎plugins/restful/plugin_handle.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void handle_add_plugin(nng_aio *aio)
4040

4141
header.ctx = aio;
4242
header.type = NEU_REQ_ADD_PLUGIN;
43-
strcpy(cmd.library, req->library);
43+
strncpy(cmd.library, req->library, NEU_PLUGIN_LIBRARY_LEN);
4444
cmd.schema_file = req->schema_file;
4545
cmd.so_file = req->so_file;
4646
ret = neu_plugin_op(plugin, header, &cmd);
@@ -64,7 +64,7 @@ void handle_update_plugin(nng_aio *aio)
6464

6565
header.ctx = aio;
6666
header.type = NEU_REQ_UPDATE_PLUGIN;
67-
strcpy(cmd.library, req->library);
67+
strncpy(cmd.library, req->library, NEU_PLUGIN_LIBRARY_LEN);
6868
cmd.schema_file = req->schema_file;
6969
cmd.so_file = req->so_file;
7070
ret = neu_plugin_op(plugin, header, &cmd);

0 commit comments

Comments
 (0)