Magellan Linux

Annotation of /trunk/hal/patches/hal-0.5.10-libhal-do-not-dereference-reason_why_locked-if-it.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 597 - (hide annotations) (download)
Mon May 19 19:05:19 2008 UTC (16 years, 1 month ago) by niro
File size: 819 byte(s)
-gentoo patches

1 niro 597 From 5f3678c9a50ffbcda1cbe2b9bb16e8665c13a68f Mon Sep 17 00:00:00 2001
2     From: Guillem Jover <guillem.jover@nokia.com>
3     Date: Tue, 20 Nov 2007 14:50:43 +0100
4     Subject: [PATCH] libhal: do not dereference *reason_why_locked if it's NULL
5    
6     Do not dereference *reason_why_locked if it's NULL after call
7     dbus_malloc0().
8     ---
9     libhal/libhal.c | 2 ++
10     1 files changed, 2 insertions(+), 0 deletions(-)
11    
12     diff --git a/libhal/libhal.c b/libhal/libhal.c
13     index 619b7a5..2697239 100644
14     --- a/libhal/libhal.c
15     +++ b/libhal/libhal.c
16     @@ -2279,6 +2279,8 @@ libhal_device_lock (LibHalContext *ctx,
17     if (reason_why_locked != NULL) {
18     *reason_why_locked =
19     dbus_malloc0 (strlen (error->message) + 1);
20     + if (*reason_why_locked == NULL)
21     + return FALSE;
22     strcpy (*reason_why_locked, error->message);
23     }
24     }
25     --
26     1.5.3.7
27