fix null pointer dereference in rz_name_filter2() in librz/util/name.c (#6846)

Co-authored-by agent: pi/deepseek-flash-guan
This commit is contained in:
Syh-Xiong
2026-10-10 12:15:53 +01:00
committed by GitHub
parent 9c0dfd47a2
commit b80b386247
+3
View File
@@ -95,6 +95,9 @@ RZ_API char *rz_name_filter2(const char *name, bool strict) {
name++;
}
char *res = rz_str_dup(name);
if (!res) {
return NULL;
}
for (i = 0; res[i]; i++) {
if (!rz_name_validate_char(res[i], strict)) {
res[i] = '_';