浏览代码

Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939

https://bugzilla.redhat.com/show_bug.cgi?id=613056
Resolves: bug 613056
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
description: Catch possible NULL pointer in substr_dn_normalize_orig().
Endi S. Dewata 15 年之前
父节点
当前提交
696e2f7911
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      ldap/servers/slapd/dn.c

+ 5 - 0
ldap/servers/slapd/dn.c

@@ -333,6 +333,11 @@ substr_dn_normalize_orig( char *dn, char *end )
 				}
 			} else if ( *s == '"' ) {
 				state = B4SEPARATOR;
+				if (!value) {
+					LDAPDebug( LDAP_DEBUG_ANY,
+						"slapi_dn_normalize - missing value\n", 0, 0, 0 );
+					break;
+				}
 				if ( value_separator == dn /* 2 or more separators */
 					 || ISSPACE( value[1] ) || ISSPACE( d[-1] ) ) {
 					*d++ = *s;