ACK: [PATCH] lib: fwts_uefi: fix check of empty d_name

Alex Hung alex.hung at canonical.com
Thu May 9 06:18:02 UTC 2013


On 05/07/2013 07:17 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Coverity CID #997279, Array compared against 0 (NO_EFFECT)
>
> Fix bug where we are comparing d_name against NULL; should
> be in fact checking if first char is '\0'.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/lib/src/fwts_uefi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
> index 16ae1da..29cad80 100644
> --- a/src/lib/src/fwts_uefi.c
> +++ b/src/lib/src/fwts_uefi.c
> @@ -399,7 +399,7 @@ int fwts_uefi_get_variable_names(fwts_list *list)
>   		return FWTS_ERROR;
>
>   	for (i = 0; i < n; i++) {
> -		if (names[i]->d_name == NULL)
> +		if (names[i]->d_name[0] == '\0')
>   			continue;
>   		if (!strcmp(names[i]->d_name, "."))
>   			continue;
>
Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list