Kernel can also write a hex value in NUMBER(X) string, for example:
vmcoreinfo_append_str("NUMBER(PHYS_OFFSET)=0x%llx\n",PHYS_OFFSET);

Therefore, allow read_vmcoreinfo_long() to read 'base 16' values if, 'base
10' read resulted in a read of invalid character.

Signed-off-by: Pratyush Anand <pan...@redhat.com>
---
 makedumpfile.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/makedumpfile.c b/makedumpfile.c
index ab9719bb678e..b2ea3ebdd4cb 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -2433,6 +2433,8 @@ read_vmcoreinfo_long(char *str_structure)
                        buf[i - 1] = '\0';
                if (strncmp(buf, str_structure, strlen(str_structure)) == 0) {
                        data = strtol(buf + strlen(str_structure), &endp, 10);
+                       if (strlen(endp) != 0)
+                               data = strtol(buf + strlen(str_structure), 
&endp, 16);
                        if ((data == LONG_MAX) || strlen(endp) != 0) {
                                ERRMSG("Invalid data in %s: %s",
                                    info->name_vmcoreinfo, buf);
-- 
2.7.4


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to