]> git.sur5r.net Git - openldap/commitdiff
Make space for trailing NUL
authorHoward Chu <hyc@openldap.org>
Sat, 18 Oct 2003 21:59:53 +0000 (21:59 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 18 Oct 2003 21:59:53 +0000 (21:59 +0000)
libraries/liblunicode/ucstr.c

index d854b2aead48fc17fdba9632b88fe7f4f4111cd0..474837ae6b4d83b994047064b13cc68bcadd66c2 100644 (file)
@@ -252,8 +252,8 @@ struct berval * UTF8bvnormalize(
                last = i;
 
                /* Allocate more space in out if necessary */
-               if (len - i > outsize - outpos) {
-                       outsize = outsize + ((len - i) - (outsize - outpos));
+               if (len - i >= outsize - outpos) {
+                       outsize += 1 + ((len - i) - (outsize - outpos));
                        outtmp = (char *) realloc(out, outsize);
                        if (outtmp == NULL) {
                                free(out);