diff --git a/Makefile b/Makefile index b9bc581..3f66ad0 100644 --- a/Makefile +++ b/Makefile @@ -211,6 +211,9 @@ privatekey.pem: windoze: $(MAKE) DIET= CROSS=i686-mingw32- asn1dump +static-analyzer: + /opt/llvm/bin/scan-build --use-cc=/opt/llvm/bin/clang make DIET= -j4 + fmt_tls_alert.o: fmt_tls_alert.c tinytls.h asn1.h fmt_tls_alert_pkt.o: fmt_tls_alert_pkt.c tinytls.h asn1.h fmt_tls_clienthello.o: fmt_tls_clienthello.c tinytls.h asn1.h diff --git a/addindex.c b/addindex.c index bf12c18..763f8d9 100644 --- a/addindex.c +++ b/addindex.c @@ -310,6 +310,9 @@ int main(int argc,char* argv[]) { buffer_putulong(buffer_1,cmaxcoll); buffer_putsflush(buffer_1," chains).\n"); + if (!nmincoll) + die(111,"can''t happen error: table size zero!?"); + maxtabsize=nmincoll; memset(tab,0,maxtabsize*sizeof(struct htentry)); @@ -372,6 +375,10 @@ int main(int argc,char* argv[]) { } } + for (j=0; jx; - if (!f) return 1; + if (!f) { + emptyset(b); + return 1; + } if (f->type==EQUAL) { /* prefer a hash index if there is one */ uint32 ofs; @@ -842,7 +845,7 @@ static int useindex(struct Filter* f,struct bitfield* b) { return 1; } case SUBSTRING: - if (f->substrings->substrtype!=prefix) return 0; + if (f->substrings->substrtype!=prefix) { emptyset(b); return 0; } { uint32 ofs; for (ofs=indices_offset+record_count*4; ofs