summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-07-06 19:18:19 -0500
committerNoriko Hosoi <nhosoi@redhat.com>2010-08-23 11:07:31 -0700
commit9020d0a1ba5766ae40d0aefe8b4b46e0e6903ee6 (patch)
treefd5664e81d2f2c375a36d1d588ac6a176612b077 /lib
parent2ff2c9da762d67628cf25a1ceda3b1dbb9218776 (diff)
downloadds-9020d0a1ba5766ae40d0aefe8b4b46e0e6903ee6.tar.gz
ds-9020d0a1ba5766ae40d0aefe8b4b46e0e6903ee6.tar.xz
ds-9020d0a1ba5766ae40d0aefe8b4b46e0e6903ee6.zip
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
https://bugzilla.redhat.com/show_bug.cgi?id=610119 Resolves: bug 610119 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199 Fix description: Catch possible NULL pointer in LASDnsBuild().
Diffstat (limited to 'lib')
-rw-r--r--lib/libaccess/lasdns.cpp6
-rw-r--r--lib/libsi18n/getstrmem.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/libaccess/lasdns.cpp b/lib/libaccess/lasdns.cpp
index 3bcbba10..a81f6808 100644
--- a/lib/libaccess/lasdns.cpp
+++ b/lib/libaccess/lasdns.cpp
@@ -152,6 +152,12 @@ LASDnsBuild(NSErr_t *errp, char *attr_pattern, LASDnsContext_t *context, int ali
PRHostEnt *he, host;
#endif
+ if (attr_pattern == NULL) {
+ nserrGenerate(errp, ACLERRINVAL, ACLERR4770, ACL_Program, 1,
+ XP_GetAdminStr(DBT_lasdnsbuildInvalidAttributePattern_));
+ return LAS_EVAL_INVALID;
+ }
+
context->Table = PR_NewHashTable(0,
PR_HashCaseString,
PR_CompareCaseStrings,
diff --git a/lib/libsi18n/getstrmem.h b/lib/libsi18n/getstrmem.h
index 937885bc..1cd72454 100644
--- a/lib/libsi18n/getstrmem.h
+++ b/lib/libsi18n/getstrmem.h
@@ -259,6 +259,7 @@ static char* libaccess[] = {
"acl_user_exists: out of memory",
"acl_user_exists: user doesn't exist anymore",
"acl_user_exists: plist error",
+ "LASDnsBuild invalid attribute pattern\n",
emptyString };
/* libraries in bucket for hashKey==9 */