Fix for the failure of the "sym <symbol>" option in the extremely

unlikely case where the symbol's name string is composed entirely of
hexadecimal characters.  For example, without the patch, "sym e820"
fails with the error message "sym: invalid address: e820".
(anderson@redhat.com)
This commit is contained in:
Dave Anderson 2016-07-14 11:38:08 -04:00
parent 09fdac65d1
commit 69a2cfa0c8

View File

@ -3927,7 +3927,8 @@ cmd_sym(void)
sp = NULL;
show_flags &= ~SHOW_MODULE;
if (clean_arg() && hexadecimal(args[optind], 0)) {
if (clean_arg() &&
(!symbol_exists(args[optind]) && hexadecimal(args[optind], 0))) {
errflag = 0;
value = htol(args[optind], RETURN_ON_ERROR,
&errflag);