summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/support/utf8_conv.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util/support/utf8_conv.c b/src/util/support/utf8_conv.c
index 58fb25022..f8e4a496b 100644
--- a/src/util/support/utf8_conv.c
+++ b/src/util/support/utf8_conv.c
@@ -119,9 +119,11 @@ k5_utf8s_to_ucs2s(krb5_ucs2 *ucs2str,
}
assert(ucs2len < count);
-
- /* Add null terminator if there's room in the buffer. */
- ucs2str[ucs2len] = 0;
+
+ if (ucs2str != NULL) {
+ /* Add null terminator if there's room in the buffer. */
+ ucs2str[ucs2len] = 0;
+ }
return ucs2len;
}