summaryrefslogtreecommitdiff
path: root/lib/system
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-08-26 15:56:19 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-09-06 14:55:00 +0200
commita80a0f727c705823239b043c82dec9bc41deef3d (patch)
tree39fe6553d0ce06ecb8e584172d64039836289594 /lib/system
parentcc3b48450d31191ee326a03dd384a29e555d9262 (diff)
downloadgnutls-a80a0f727c705823239b043c82dec9bc41deef3d.tar.gz
_gnutls_ucs2_to_utf8: fixed null termination check in windows code
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/iconv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/system/iconv.c b/lib/system/iconv.c
index b06a6db346..fa7f72e27a 100644
--- a/lib/system/iconv.c
+++ b/lib/system/iconv.c
@@ -56,7 +56,7 @@ int _gnutls_ucs2_to_utf8(const void *data, size_t size,
checked = 1;
}
- if (((uint8_t *) data)[size] == 0 && ((uint8_t *) data)[size+1] == 0) {
+ if (size > 2 && ((uint8_t *) data)[size-1] == 0 && ((uint8_t *) data)[size-2] == 0) {
size -= 2;
}