ACK: [PATCH] fwts_acpica: fix potential null ptr dereference (LP: #1298419)

Alex Hung alex.hung at canonical.com
Mon Mar 31 06:01:29 UTC 2014


On 03/27/2014 10:30 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> smatch detected a potential null ptr dereference issue, we should
> ensure that buffer is allocated before scan it with index().
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/acpica/fwts_acpica.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
> index 9d92470..cc691c3 100644
> --- a/src/acpica/fwts_acpica.c
> +++ b/src/acpica/fwts_acpica.c
> @@ -440,7 +440,7 @@ void fwts_acpica_vprintf(const char *fmt, va_list args)
>   		}
>   	}
>
> -	if (index(buffer, '\n') != NULL) {
> +	if (buffer_len && index(buffer, '\n') != NULL) {
>   		fwts_log_info(fwts_acpica_fw, "%s", buffer);
>   		free(buffer);
>   		buffer_len = 0;
>

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



More information about the fwts-devel mailing list