anal_pickle coverity fixes (#20504)

* Add missing % in anal_pickle log format string
* Ensure arg is never NULL in pickle_opasm
This commit is contained in:
Lazula 2022-07-28 16:15:07 -05:00 committed by GitHub
parent a4c97fb052
commit afa2963f73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -444,7 +444,7 @@ static inline bool write_num_sz(ut64 n, int byte_sz, ut8 *outbuf, int outsz) {
int bits = r_num_to_bits (NULL, n);
// TODO: signedness prbly wrong...
if (bits > byte_sz * 8) {
R_LOG_ERROR ("Arg 0x" PFMT64x " more then %d bits", n, bits);
R_LOG_ERROR ("Arg 0x%" PFMT64x " is more than %d bits", n, bits);
false;
}
switch (byte_sz) {
@ -536,6 +536,8 @@ static int pickle_opasm(RAnal *a, ut64 addr, const char *str, ut8 *outbuf, int o
*arg = '\0';
arg++;
arg = r_str_ichr (arg, ' ');
} else {
arg = "";
}
if (write_op (opstr, outbuf)) {