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_ldapmodifyrequest.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'scan_ldapmodifyrequest.c') diff --git a/scan_ldapmodifyrequest.c b/scan_ldapmodifyrequest.c index 8a08388..832d629 100644 --- a/scan_ldapmodifyrequest.c +++ b/scan_ldapmodifyrequest.c @@ -1,4 +1,5 @@ #include +#include #include "ldap.h" #if 0 @@ -19,7 +20,7 @@ size_t scan_ldapmodifyrequest(const char* src,const char* max,struct ModifyRequest* m) { size_t res,tmp,oslen; /* outer sequence length */ struct Modification* last=0; - m->m.next=0; + byte_zero(m,sizeof(*m)); if (!(res=scan_ldapstring(src,max,&m->object))) goto error; if (!(tmp=scan_asn1SEQUENCE(src+res,max,&oslen))) goto error; res+=tmp; @@ -27,11 +28,11 @@ size_t scan_ldapmodifyrequest(const char* src,const char* max,struct ModifyReque max=src+res+oslen; if (src+res>=max) goto error; /* need at least one record */ do { - size_t islen; - unsigned long etmp; + size_t islen, etmp; if (last) { struct Modification* cur; if (!(cur=malloc(sizeof(struct Modification)))) goto error; + byte_zero(cur,sizeof(*cur)); last->next=cur; last=cur; } else last=&m->m; @@ -39,7 +40,8 @@ size_t scan_ldapmodifyrequest(const char* src,const char* max,struct ModifyReque if (!(tmp=scan_asn1SEQUENCE(src+res,max,&islen))) goto error; res+=tmp; if (!(tmp=scan_asn1ENUMERATED(src+res,max,&etmp))) goto error; - if (etmp>2) goto error; last->operation=etmp; res+=tmp; + if (etmp>2) goto error; + last->operation=etmp; res+=tmp; { size_t iislen; /* urgh, _three_ levels of indirection */ const char* imax; @@ -60,8 +62,8 @@ size_t scan_ldapmodifyrequest(const char* src,const char* max,struct ModifyReque ilast=&last->vals; while (src+resa))) goto error; - (*ilast)->next=0; ilast=&(*ilast)->next; res+=tmp; } -- cgit v1.2.3-55-g7522