[xiph-commits] r15358 - icecast/trunk/icecast/src
karl at svn.xiph.org
karl at svn.xiph.org
Tue Sep 30 18:07:30 PDT 2008
Author: karl
Date: 2008-09-30 18:07:29 -0700 (Tue, 30 Sep 2008)
New Revision: 15358
Modified:
icecast/trunk/icecast/src/auth.c
icecast/trunk/icecast/src/auth_htpasswd.c
Log:
guard for 2 NULL pointer cases raised by coverity. Neither should occur in practice
Modified: icecast/trunk/icecast/src/auth.c
===================================================================
--- icecast/trunk/icecast/src/auth.c 2008-09-30 20:24:56 UTC (rev 15357)
+++ icecast/trunk/icecast/src/auth.c 2008-10-01 01:07:29 UTC (rev 15358)
@@ -93,8 +93,7 @@
{
auth_t *auth;
- if (auth_user == NULL || (mountinfo == NULL && auth_user->client
- && auth_user->client->auth == NULL))
+ if (auth_user == NULL)
return;
auth_user->next = NULL;
if (mountinfo)
@@ -107,6 +106,11 @@
}
else
{
+ if (auth_user->client == NULL || auth_user->client->auth == NULL)
+ {
+ WARN1 ("internal state is incorrect for %p", auth_user->client);
+ return;
+ }
auth = auth_user->client->auth;
thread_mutex_lock (&auth->lock);
}
Modified: icecast/trunk/icecast/src/auth_htpasswd.c
===================================================================
--- icecast/trunk/icecast/src/auth_htpasswd.c 2008-09-30 20:24:56 UTC (rev 15357)
+++ icecast/trunk/icecast/src/auth_htpasswd.c 2008-10-01 01:07:29 UTC (rev 15358)
@@ -111,6 +111,8 @@
char *sep;
char line [MAX_LINE_LEN];
+ if (htpasswd->filename == NULL)
+ return;
if (stat (htpasswd->filename, &file_stat) < 0)
{
WARN1 ("failed to check status of %s", htpasswd->filename);
More information about the commits
mailing list