qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 6/8] s390-ccw: interactive boot menu for eckd


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCH v3 6/8] s390-ccw: interactive boot menu for eckd dasd (print menu)
Date: Wed, 17 Jan 2018 09:58:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 15.01.2018 17:44, Collin L. Walling wrote:
> Prints the menu data starting from the zIPL menu banner.
> 
> Signed-off-by: Collin L. Walling <address@hidden>
> ---
[...]
>  static void run_eckd_boot_script(block_number_t mbr_block_nr,
> diff --git a/pc-bios/s390-ccw/menu.c b/pc-bios/s390-ccw/menu.c
> index e15a7f2..30470b3 100644
> --- a/pc-bios/s390-ccw/menu.c
> +++ b/pc-bios/s390-ccw/menu.c
> @@ -10,10 +10,52 @@
>   */
>  
>  #include "menu.h"
> +#include "s390-ccw.h"
>  
>  static uint8_t flags;
>  static uint64_t timeout;
>  
> +static void zipl_println(const char *data, size_t len)
> +{
> +    char buf[len + 1];
> +
> +    ebcdic_to_ascii(data, buf, len);
> +    buf[len] = '\n';
> +    buf[len + 1] = '\0';

Buffer overflow by 1. You need to declare "char buf[len + 2]".
Or drop the 0-termination and use write(1, buf, len + 1) instead of
sclp_print().

> +    sclp_print(buf);
> +}

 Thomas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]