Fixed two formatter issues

- Unintentional fallthrough
- Assertion on 0-length append
This commit is contained in:
Joel Höner 2017-10-17 17:44:19 +02:00
parent c77c9f2561
commit d2c6115f6f
2 changed files with 8 additions and 2 deletions

View File

@ -332,8 +332,10 @@ ZydisStatus ZydisPrintStr(char** buffer, size_t bufferLen, const char* text,
break;
case ZYDIS_LETTER_CASE_LOWER:
ZydisToLowerCase(*buffer, strLen);
break;
case ZYDIS_LETTER_CASE_UPPER:
ZydisToUpperCase(*buffer, strLen);
break;
default:
ZYDIS_UNREACHABLE;
}

View File

@ -464,7 +464,7 @@ static ZydisStatus ZydisFormatterPrintOperandSizeIntel(const ZydisFormatter* for
}
if (typecast)
{
char* str = "";
const char* str = NULL;
switch (typecast)
{
case 8:
@ -497,7 +497,11 @@ static ZydisStatus ZydisFormatterPrintOperandSizeIntel(const ZydisFormatter* for
default:
break;
}
return ZydisPrintStr(buffer, bufferLen, str, ZYDIS_LETTER_CASE);
if (str)
{
return ZydisPrintStr(buffer, bufferLen, str, ZYDIS_LETTER_CASE);
}
}
return ZYDIS_STATUS_SUCCESS;
}