[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: [PATCH] - fix warning in kdelibs-3.1rc5/dcop/KDE-ICE/getauth.c
From: Jesper Juhl <jju () dif ! dk>
Date: 2002-12-10 13:07:39
[Download RAW message or body]
Hi,
I'm trying to get started on some KDE hacking, and I'm starting out by trying
to fix various warnings in the current KDE3.1RC5.
I encountered this :
getauth.c: In function `_KDE_IceGetPaAuthData':
getauth.c:105: warning: `entry' might be used uninitialized in this function
while compiling kdelibs-3.1rc5, and created the attached patch
(kdelibs-dcop-KDE-ICE-getauth.c-1.patch) in an attempt to fix it.
To fix the warning I added an initialization of "entry" to NULL, and then a
bit later (where entry is used) a check to make sure it was not NULL so the
code will never end up dereferencing a NULL pointer.
Since I could not find any reference to a developer in the source file I mail
this to kde-core-devel, since I read on www.kde.org that this is the general
list for kdelibs.
If the patch is considered good, where would I send it for inclusion? or do I
not need to send it anywhere except this list?
Since I'm just getting started on KDE hacking, I welcome any comments :)
Best regards,
Jesper Juhl
["kdelibs-dcop-KDE-ICE-getauth.c-1.patch" (text/x-diff)]
--- orig/kdelibs-3.1rc5/dcop/KDE-ICE/getauth.c 2002-01-25 18:12:07.000000000 +0100
+++ kdelibs-3.1rc5/dcop/KDE-ICE/getauth.c 2002-12-10 13:47:52.000000000 +0100
@@ -102,7 +102,7 @@
char **authDataRet;
{
- IceAuthDataEntry *entry;
+ IceAuthDataEntry *entry = NULL;
int found = 0;
int i;
@@ -116,7 +116,7 @@
strcmp (authName, entry->auth_name) == 0;
}
- if (found)
+ if (found && entry)
{
*authDataLenRet = entry->auth_data_length;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic