ACK: [PATCH] fwts_log_plaintext: check for null pointer

Alex Hung alex.hung at canonical.com
Mon Jun 10 20:29:10 UTC 2019


On 2019-06-10 3:54 a.m., Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> The pointer 'lines' can potentially be null, so check for this.
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/lib/src/fwts_log_plaintext.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/lib/src/fwts_log_plaintext.c b/src/lib/src/fwts_log_plaintext.c
> index 1151603e..a8cbfb53 100644
> --- a/src/lib/src/fwts_log_plaintext.c
> +++ b/src/lib/src/fwts_log_plaintext.c
> @@ -130,6 +130,8 @@ static int fwts_log_print_plaintext(
>  	else
>  		lines = fwts_format_text(tmpbuf + header_len, log_file->line_width - header_len);
>  
> +	if (!lines)
> +		return 0;
>  	len = n;
>  
>  	fwts_list_foreach(item, lines) {
> 

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list