summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fmt_ldapsearchfilter.c3
-rw-r--r--scan_ldapsearchfilterstring.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/fmt_ldapsearchfilter.c b/fmt_ldapsearchfilter.c
index ceb3746..380bb15 100644
--- a/fmt_ldapsearchfilter.c
+++ b/fmt_ldapsearchfilter.c
@@ -51,7 +51,7 @@ size_t fmt_ldapsearchfilter(char* dest,const struct Filter* f) {
}
break;
case PRESENT:
- return fmt_asn1string(dest,PRIVATE,PRIMITIVE,(enum asn1_tag)f->type,f->ava.desc.s,f->ava.desc.l);
+ sum=fmt_asn1string(dest,PRIVATE,PRIMITIVE,(enum asn1_tag)f->type,f->ava.desc.s,f->ava.desc.l);
break;
default: return 0;
}
@@ -61,6 +61,7 @@ size_t fmt_ldapsearchfilter(char* dest,const struct Filter* f) {
if (dest) sum+=fmt_ldapsearchfilter(dest+sum,f->next);
else sum+=fmt_ldapsearchfilter(dest,f->next);
}
+ if (f->type == PRESENT) return sum;
tmp=fmt_asn1length(0,savesum);
if (!dest) return sum+tmp+1;
diff --git a/scan_ldapsearchfilterstring.c b/scan_ldapsearchfilterstring.c
index 8f8b9ff..4e35523 100644
--- a/scan_ldapsearchfilterstring.c
+++ b/scan_ldapsearchfilterstring.c
@@ -46,7 +46,7 @@ scan_filterlist:
if (*(++s)=='*') {
if (*(++s)==')') {
(*f)->type=PRESENT;
- return s-src;
+ return s-src+1;
}
(*f)->type=SUBSTRING;
substring: