diff mbox

uefi: eufidump: fix infinite recursion on unknown end terminator

Message ID 1328872469-18154-1-git-send-email-colin.king@canonical.com
State Rejected
Headers show

Commit Message

Colin Ian King Feb. 10, 2012, 11:14 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/uefi/uefidump/uefidump.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Colin Ian King Feb. 10, 2012, 11:15 a.m. UTC | #1
On 10/02/12 11:14, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king@canonical.com>
> ---
>   src/uefi/uefidump/uefidump.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
> index 6c5fbd4..9a12dc7 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -64,14 +64,14 @@ static char *uefidump_vprintf(char *str, const char *fmt, ...)
>   static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path)
>   {
>   	switch (dev_path->type&  0x7f) {
> +printf("%x %s\n", dev_path->type, path);

NACK - got debug in it still!

>   	case FWTS_UEFI_END_DEV_PATH_TYPE:
>   		switch (dev_path->subtype) {
>   		case FWTS_UEFI_END_ENTIRE_DEV_PATH_SUBTYPE:
>   		case FWTS_UEFI_END_THIS_DEV_PATH_SUBTYPE:
>   			break;
>   		default:
> -			path = uefidump_vprintf(path, "\\Unknown-End(0x%x)", (unsigned int) dev_path->subtype);
> -              		break;
> +			return uefidump_vprintf(path, "\\Unknown-End(0x%x)", (unsigned int) dev_path->subtype);
>   		}
>   		break;
>   	case FWTS_UEFI_HARDWARE_DEV_PATH_TYPE:

Nacked-by: Colin King
diff mbox

Patch

diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
index 6c5fbd4..9a12dc7 100644
--- a/src/uefi/uefidump/uefidump.c
+++ b/src/uefi/uefidump/uefidump.c
@@ -64,14 +64,14 @@  static char *uefidump_vprintf(char *str, const char *fmt, ...)
 static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path)
 {
 	switch (dev_path->type & 0x7f) {
+printf("%x %s\n", dev_path->type, path);
 	case FWTS_UEFI_END_DEV_PATH_TYPE:
 		switch (dev_path->subtype) {
 		case FWTS_UEFI_END_ENTIRE_DEV_PATH_SUBTYPE:
 		case FWTS_UEFI_END_THIS_DEV_PATH_SUBTYPE:
 			break;
 		default:
-			path = uefidump_vprintf(path, "\\Unknown-End(0x%x)", (unsigned int) dev_path->subtype);
-              		break;
+			return uefidump_vprintf(path, "\\Unknown-End(0x%x)", (unsigned int) dev_path->subtype);
 		}
 		break;
 	case FWTS_UEFI_HARDWARE_DEV_PATH_TYPE: