FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 06-03-2010, 10:58 PM
"Brian C. Lane"
 
Default Add check for return value of getuuidbydev (#592294)

-----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@redhat.com>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEVAwUBTAgzixF+jBaO/jp/AQJtPgf+KoH2CWEvuLM8xiXMY+qLWgQy1jBXdSUw
rZntdz/Tm6RN0WlcO8Pmljvfl9YZh9M5EnJDeg94C0q5QARRJYKh7o+Iv V1xP1/5
alhcUqqFva4v9nQV6DN0XZvFm1ZH9/Zzc1RBCgLem9kdqnYwhw48BvvrAb20bZY2
CAQiuPxdWxar0UVK5THtWbB2fe6TKTGPLtA3vcC9GviMvDH3Dl vevqz9YWSL89/Q
JpxWno37zow8vw+7xjv4euAjEY8v1GXmzkYn2lvoEiVS/ieYr7C6214iyCJw/YQr
nrWEdYzaiK2WjZsXY8P71HX8zRvK9E0KhL1bmCQp2xjGXIJL5j BIgw==
=Qc0S
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-04-2010, 06:35 AM
Hans de Goede
 
Default Add check for return value of getuuidbydev (#592294)

Ack.

And great to see that you're working on grubby, that is definitely one
package which could use a bit of love.

Regards,

Hans


On 06/04/2010 12:57 AM, 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 | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/grubby.c b/grubby.c
index ccc0279..c984c04 100644
--- a/grubby.c
+++ b/grubby.c
@@ -1293,6 +1293,10 @@ int suitableImage(struct singleEntry * entry, const char * bootPrefix,
if (!rootdev)
return 0;

+ if (!getuuidbydev(rootdev) || !getuuidbydev(dev)) {
+ free(rootdev);
+ return 0;
+ }

if (strcmp(getuuidbydev(rootdev), getuuidbydev(dev))) {
free(rootdev);


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

Thread Tools




All times are GMT. The time now is 09:29 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org