ACK: [PATCH] fwts_log_plaintext: check for null pointer

ivanhu ivan.hu at canonical.com
Tue Jun 11 05:44:18 UTC 2019


On 6/10/19 6:54 PM, 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: Ivan Hu <ivan.hu at canonical.com>




More information about the fwts-devel mailing list