Explorar o código

Ticket 47722 - rsearch filter error on any search filter

Bug Description:  A NULL gets incorrectly added to the search filter, which
                  creates an invalid filter.

Fix Description:  Do not add a NULL character to the search filter.

Original fix submitted by nkinder(Thanks!)

https://fedorahosted.org/389/ticket/47722

Reviewed by: nhoosi(Thanks!)
Mark Reynolds %!s(int64=11) %!d(string=hai) anos
pai
achega
8afcf90b0d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      ldap/servers/slapd/tools/rsearch/searchthread.c

+ 1 - 1
ldap/servers/slapd/tools/rsearch/searchthread.c

@@ -387,7 +387,7 @@ static int st_search(SearchThread *st)
             sprintf(num, "%d", get_large_random_number() % numeric);
             s = num;
         }
-        sprintf(filterBuffer, "%s%s", filter, s);
+        sprintf(filterBuffer, "%s%s", filter, s ? s : "");
         pFilter = filterBuffer;
     } else {
         pFilter = filter;