Re: [PATCH grubby] Add check for return value of getuuidbydev (#592294)

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/03/2010 03:45 PM, Brian C. Lane wrote:
> If the device doesn't exist this can return a null. Check before calling
> strcmp() and return 0 if it fails.
> 
> Resolves: rhbz#592294
> ---
>  grubby.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/grubby.c b/grubby.c
> index ccc0279..0439381 100644
> --- a/grubby.c
> +++ b/grubby.c
> @@ -1293,6 +1293,8 @@ int suitableImage(struct singleEntry * entry, const char * bootPrefix,
>      if (!rootdev)
>  	return 0;
>  
> +    if (!getuuidbydev(rootdev) || !getuuidbydev(dev))
> +        return 0;
>  
>      if (strcmp(getuuidbydev(rootdev), getuuidbydev(dev))) {
>  	free(rootdev);

Nak to that leaky thing. List traffic is light today anyway, non-leaky
patch should show up in a sec.

- -- 
Brian C. Lane <bcl@xxxxxxxxxx>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEVAwUBTAgzixF+jBaO/jp/AQJtPgf+KoH2CWEvuLM8xiXMY+qLWgQy1jBXdSUw
rZntdz/Tm6RN0WlcO8Pmljvfl9YZh9M5EnJDeg94C0q5QARRJYKh7o+IvV1xP1/5
alhcUqqFva4v9nQV6DN0XZvFm1ZH9/Zzc1RBCgLem9kdqnYwhw48BvvrAb20bZY2
CAQiuPxdWxar0UVK5THtWbB2fe6TKTGPLtA3vcC9GviMvDH3Dlvevqz9YWSL89/Q
JpxWno37zow8vw+7xjv4euAjEY8v1GXmzkYn2lvoEiVS/ieYr7C6214iyCJw/YQr
nrWEdYzaiK2WjZsXY8P71HX8zRvK9E0KhL1bmCQp2xjGXIJL5jBIgw==
=Qc0S
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux