bin.str.enc: Check for NULL (#15493)

This commit is contained in:
Khairul Azhar Kasmiran 2019-11-24 17:43:40 +08:00 committed by radare
parent b4c62998a1
commit 6906946135

View File

@ -737,7 +737,9 @@ static RDisasmState * ds_init(RCore *core) {
ds->nbytes = r_config_get_i (core->config, "asm.nbytes");
ds->show_asciidot = !strcmp (core->print->strconv_mode, "asciidot");
const char *strenc_str = r_config_get (core->config, "bin.str.enc");
if (!strcmp (strenc_str, "latin1")) {
if (!strenc_str) {
ds->strenc = R_STRING_ENC_GUESS;
} else if (!strcmp (strenc_str, "latin1")) {
ds->strenc = R_STRING_ENC_LATIN1;
} else if (!strcmp (strenc_str, "utf8")) {
ds->strenc = R_STRING_ENC_UTF8;