Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/hal/hisi/hal_hisi.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,12 @@ static void get_hisi_sdk(cJSON *j_inner) {
return;
*ptr++ = ' ';
*ptr++ = '(';
strcpy(ptr, build + 1);
/* build+1 and ptr alias the same buffer (the bracketed build
* time sits after the ']' we just overwrote), so this is an
* overlapping copy: strcpy() is UB here (ASAN: strcpy-param-
* overlap), memmove() is well-defined and yields the same
* "<version> (<build time>)" string. */
memmove(ptr, build + 1, strlen(build + 1) + 1);
strcat(ptr, ")");
ADD_PARAM("sdk", buf);
}
Expand Down
Loading