summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2014-06-12 06:10:18 +0000
committerolavmrk <olavmrk@a716ebb1-153a-0410-b759-cfb97c6a1b53>2014-06-12 06:10:18 +0000
commit639c5be4a600ebc413838a3c273fb3965b2ab48b (patch)
tree9c34520c5bf741595ae4773e3f0dd7c74903dcbf
parent7d4fb02b30ce21cce52f75d34f736d59de06b24c (diff)
downloadmod_auth_mellon-639c5be4a600ebc413838a3c273fb3965b2ab48b.zip
mod_auth_mellon-639c5be4a600ebc413838a3c273fb3965b2ab48b.tar.gz
mod_auth_mellon-639c5be4a600ebc413838a3c273fb3965b2ab48b.tar.xz
Fix potential NULL Dereference bugs
Found by Coverity Signed-off-by: Simo Sorce <simo@redhat.com> git-svn-id: https://modmellon.googlecode.com/svn/trunk@229 a716ebb1-153a-0410-b759-cfb97c6a1b53
-rw-r--r--auth_mellon_util.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/auth_mellon_util.c b/auth_mellon_util.c
index ad9e90a..6219c83 100644
--- a/auth_mellon_util.c
+++ b/auth_mellon_util.c
@@ -613,6 +613,10 @@ int am_urldecode(char *data)
char *op;
int c1, c2;
+ if (data == NULL) {
+ return HTTP_BAD_REQUEST;
+ }
+
ip = data;
op = data;
while (*ip) {
@@ -1343,8 +1347,8 @@ const char *am_get_mime_header(request_rec *r, const char *m, const char *h)
if (((value = am_xstrtok(r, line, ":", &l2)) != NULL) &&
(strcasecmp(value, h) == 0)) {
- value = am_xstrtok(r, NULL, ":", &l2);
- am_strip_blank(&value);
+ if ((value = am_xstrtok(r, NULL, ":", &l2)) != NULL)
+ am_strip_blank(&value);
return value;
}
}
@@ -1395,9 +1399,9 @@ const char *am_get_header_attr(request_rec *r, const char *h,
attr_name = am_xstrtok(r, attr, "=", &l2);
if ((attr_name != NULL) && (strcasecmp(attr_name, a) == 0)) {
- attr_value = am_xstrtok(r, NULL, "=", &l2);
+ if ((attr_value = am_xstrtok(r, NULL, "=", &l2)) != NULL)
am_strip_blank(&attr_value);
- break;
+ break;
}
}