소스 검색

Bug 630097 - (cov#15465) Null dereference in USN code

At the end of the for loop, be will be NULL if we never find a
valid be->be_usn_counter.  This will cause us to dereference a
NULL pointer at the next if statement after the for loop.  We
need to check if be is NULL before dereferencing it.
Nathan Kinder 15 년 전
부모
커밋
b953326204
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      ldap/servers/plugins/usn/usn.c

+ 1 - 1
ldap/servers/plugins/usn/usn.c

@@ -582,7 +582,7 @@ usn_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter,
                 break;
             }
         }
-        if (be->be_usn_counter) {
+        if (be && be->be_usn_counter) {
             /* get a next USN counter from be_usn_counter; 
              * then minus 1 from it */
             PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "%" NSPRI64 "d",