librz/analysis: prefix analysis fix memmove() call (#4918)

This commit is contained in:
Tushar Jain 2025-02-21 20:40:05 +05:30 committed by GitHub
parent e742a10af7
commit e76b9e2d60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5208,8 +5208,12 @@ static void *AnalysisBytesContext_next(RzIterator *it) {
*sp = 0;
if (op->prefix) {
char *p = strchr(sp + 1, ' ');
*p = 0;
memmove(ctx->mnemonic, sp + 1, p - sp);
if (!p) {
rz_str_ncpy(ctx->mnemonic, sp + 1, strlen(sp + 1) + 1);
} else {
*p = 0;
rz_str_ncpy(ctx->mnemonic, sp + 1, p - sp);
}
}
}
op->mnemonic = mnem;