2
0
forked from Ivasoft/DSView

set strncpy buffer size

This commit is contained in:
dreamsourcelabTAI
2023-06-26 17:55:03 +08:00
parent be3f578ce5
commit c48e6bae75
3 changed files with 3 additions and 3 deletions

View File

@@ -930,7 +930,7 @@ bool ProtocolDock::protocol_sort_callback(const DecoderInfoItem *o1, const Decod
assert(false);
}
char buf[25];
strncpy(buf, id, sizeof(buf));
strncpy(buf, id, sizeof(buf)-1);
char *rd = buf;
char *start = NULL;
int len = 0;