Skip to content

Commit f5c8547

Browse files
suleif0wargio
andcommitted
add minimum to stop any overflows
Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>
1 parent 7ca43da commit f5c8547

File tree

1 file changed

+1
-1
lines changed
  • subprojects/rzgdb/src/gdbclient

1 file changed

+1
-1
lines changed

subprojects/rzgdb/src/gdbclient/xml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ static int gdbr_parse_processes_xml(libgdbr_t *g, char *xml_data, ut64 len, int
408408

409409
column += sizeof("<column name=\"command\">") - 1;
410410
column_data_len = column_end - column;
411-
memcpy(cmdline, column, column_data_len);
411+
memcpy(cmdline, column, RZ_MIN(column_data_len, sizeof(cmdline)));
412412
cmdline[column_data_len] = '\0';
413413

414414
// Attempt to read the pid's info from /proc. Non UNIX systems will have the

0 commit comments

Comments
 (0)