From b3d98a9189a21bf02e0607b732b5c6c24da676a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sat, 9 Oct 2010 10:16:29 +0000 Subject: [PATCH] Improve getprop mem dump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the whole buffer supplied by the client is traced. AIX uses buffer sizes such as 64, 256, 1024 on properties that might not exist or contain 1 or 8 bytes. Limit the output to the amount of data actually written into the buffer. Signed-off-by: Andreas Färber Signed-off-by: Blue Swirl git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@893 f158a5a8-5612-0410-a976-696ce0be7e32 --- libopenbios/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libopenbios/client.c b/libopenbios/client.c index 2b78dcc..a93d8a3 100644 --- a/libopenbios/client.c +++ b/libopenbios/client.c @@ -171,7 +171,8 @@ static void dump_return(prom_args_t *pb) printk("0x%08lx\n", pb->args[pb->nargs]); } else if (strcmp(pb->service, "getprop") == 0) { printk("%ld\n", pb->args[pb->nargs]); - memdump((char*)pb->args[2], pb->args[3]); + if ((long)pb->args[pb->nargs] != -1) + memdump((char*)pb->args[2], MIN(pb->args[3], pb->args[pb->nargs])); } else if (strcmp(pb->service, "nextprop") == 0) { printk("%ld\n", pb->args[pb->nargs]); memdump((char*)pb->args[2], pb->args[pb->nargs]);