From ef109f86c790f12eb967ebae27c9f2f435f96156 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 8 May 2017 11:22:51 +0200 Subject: [PATCH] librpc:ndr: Set the length to 1 if we assign and empty string CID #1399648 Signed-off-by: Andreas Schneider Reviewed-by: Volker Lendecke --- librpc/ndr/ndr_string.c | 1 + 1 file changed, 1 insertion(+) diff --git a/librpc/ndr/ndr_string.c b/librpc/ndr/ndr_string.c index f9366b494a8..067f91781ee 100644 --- a/librpc/ndr/ndr_string.c +++ b/librpc/ndr/ndr_string.c @@ -677,6 +677,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_charset_to_null(struct ndr_push *ndr, int nd if (str == NULL) { str = ""; + length = 1; } return ndr_push_charset(ndr, ndr_flags, str, length, byte_mul, chset);