From 66368d28f4f277dfc9aa1975b77194c74be8632c Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 18 Oct 2003 21:59:53 +0000 Subject: [PATCH] Make space for trailing NUL --- libraries/liblunicode/ucstr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/liblunicode/ucstr.c b/libraries/liblunicode/ucstr.c index d854b2aead..474837ae6b 100644 --- a/libraries/liblunicode/ucstr.c +++ b/libraries/liblunicode/ucstr.c @@ -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); -- 2.39.5