From b61176f17b59a94750dff1f959231dadc4e6078a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 21 Apr 2017 16:31:06 +0200 Subject: Update ldap/asn1/... files with current tinyldap --- scan_ldapsearchfilter.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'scan_ldapsearchfilter.c') diff --git a/scan_ldapsearchfilter.c b/scan_ldapsearchfilter.c index 3c58df5..1a08141 100644 --- a/scan_ldapsearchfilter.c +++ b/scan_ldapsearchfilter.c @@ -32,8 +32,7 @@ size_t scan_ldapsearchfilter(const char* src,const char* max,struct Filter** f) { enum asn1_tagclass tc; enum asn1_tagtype tt; - size_t len,res,tmp; - unsigned long tag; + size_t tag,len,res,tmp; const char* nmax; *f=0; if (!(res=scan_asn1tag(src,max,&tc,&tt,&tag))) goto error; @@ -42,10 +41,7 @@ size_t scan_ldapsearchfilter(const char* src,const char* max,struct Filter** f) res+=tmp; nmax=src+res+len; if (nmax>max) goto error; - if (!(*f=malloc(sizeof(struct Filter)))) goto error; - (*f)->next=0; - (*f)->x=0; - (*f)->substrings=0; + if (!(*f=calloc(1,sizeof(struct Filter)))) goto error; switch ((*f)->type=tag) { case 0: /* and [0] SET OF Filter, */ case 1: /* or [1] SET OF Filter, */ @@ -85,13 +81,12 @@ size_t scan_ldapsearchfilter(const char* src,const char* max,struct Filter** f) res+=tmp; if (src+res+len2!=nmax) goto error; while (src+ress.s,&s->s.l))) { free(s); goto error; } - if (x>2) goto error; + if (!(tmp=scan_asn1string(src+res,nmax,&tc,&tt,&x,&s->s.s,&s->s.l)) || x>2) { free(s); goto error; } s->substrtype=x; res+=tmp; s->next=(*f)->substrings; -- cgit v1.2.3-55-g7522