Bug 610119
Description
Endi Sukma Dewata
2010-07-01 15:27:17 UTC
Created attachment 429071 [details]
0001-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429073 [details]
0002-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429074 [details]
0003-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429075 [details]
0004-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429076 [details]
0005-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429077 [details]
0006-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429078 [details]
0007-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429079 [details]
0008-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429080 [details]
0009-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429081 [details]
0010-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429082 [details]
0011-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429083 [details]
0012-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429084 [details]
0013-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429085 [details]
0014-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429086 [details]
0015-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429087 [details]
0016-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429088 [details]
0017-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429090 [details]
0018-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429091 [details]
0019-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429092 [details]
0020-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429093 [details]
0021-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Comment on attachment 429077 [details]
0006-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
this will leak entry_string and wrapped_symmetric_key
Comment on attachment 429078 [details]
0007-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
this will leak dn
Comment on attachment 429078 [details]
0007-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
never mind - will not leak
Comment on attachment 429084 [details]
0013-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
looks like it may be possible for rc != 0 and values != NULL - so you may want to move the slapi_vattr_values_free after the close brace
Comment on attachment 429092 [details]
0020-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
is 0 return the correct thing here? 0 return means success
Can you move the if attr_pattern == NULL check before line 155? That is, avoid allocating context->Table and context->pool if attr_pattern == NULL
Unless it is perfectly valid to have attr_pattern == NULL
Created attachment 429915 [details]
0006a-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429933 [details]
0013a-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 429937 [details]
0020a-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Created attachment 431244 [details]
0011a-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
Fixed a problem during merging.
Comment on attachment 429937 [details] 0020a-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12196&streamDefectId=12382&defectInstanceId=14272&fileInstanceId=49195 Created attachment 440071 [details] 0006b-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12168&streamDefectId=12354&defectInstanceId=14244&fileInstanceId=49322 I propose a new patch for 0006a-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch. Description: Since both pb and entry_string have no chance to be NULL (both memories are allocated using slapi_ch_*alloc functions), we don't need to check the NULL possibilities. Created attachment 440073 [details] 0011b-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12190&streamDefectId=12376&defectInstanceId=14266&fileInstanceId=49336 I propose a new patch for 0011a-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch. Description: Regarding upgradedb_copy_logfiles, check NULL or empty string for src and dest first. Then, we can eliminate the broken "from" and "to" cases. Both memories are allocated using slapi_ch_calloc, we don't have to check the NULL possibility of from and/or to. I also replaced sprintf with PR_snprintf and added debug print for dblayer_copyfile. Comment on attachment 440071 [details]
0006b-Bug-610119-fix-coverify-Defect-Type-Null-pointer-der.patch
actually, would be better to use slapi_ch_free_string(&entry_string);
On behalf of Endi (edewata), pushed to master. $ git merge coverity Updating d7c4d9b..e5fe26a Fast-forward include/libaccess/aclerror.h | 1 + include/libaccess/dbtlibaccess.h | 1 + ldap/servers/slapd/back-ldbm/dbhelp.c | 12 +++- ldap/servers/slapd/back-ldbm/dblayer.c | 2 + ldap/servers/slapd/back-ldbm/findentry.c | 72 ++++++++++++-------- ldap/servers/slapd/back-ldbm/import-threads.c | 16 +++- ldap/servers/slapd/back-ldbm/import.c | 7 ++- ldap/servers/slapd/back-ldbm/index.c | 33 +++++---- ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c | 8 +-- ldap/servers/slapd/back-ldbm/ldbm_config.c | 9 +++ ldap/servers/slapd/back-ldbm/ldbm_index_config.c | 45 +++++++++---- .../servers/slapd/back-ldbm/ldbm_instance_config.c | 27 ++++++-- ldap/servers/slapd/back-ldbm/ldbm_modify.c | 11 ++- ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 38 ++++++----- ldap/servers/slapd/back-ldbm/vlv.c | 16 +++- ldap/servers/slapd/plugin_syntax.c | 46 +++++++----- ldap/servers/slapd/pw.c | 9 ++- ldap/servers/slapd/regex.c | 3 +- ldap/servers/slapd/saslbind.c | 11 +-- ldap/servers/slapd/schema.c | 16 ++++- ldap/servers/slapd/tools/ldclt/scalab01.c | 10 +++- ldap/servers/snmp/ldap-agent.c | 21 ++++-- lib/libaccess/lasdns.cpp | 6 ++ lib/libaccess/usrcache.cpp | 14 ++-- lib/libsi18n/getstrmem.h | 1 + 25 files changed, 288 insertions(+), 147 deletions(-) $ git push Counting objects: 183, done. Delta compression using up to 4 threads. Compressing objects: 100% (145/145), done. Writing objects: 100% (145/145), 16.16 KiB, done. Total 145 (delta 124), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git d7c4d9b..e5fe26a master -> master |