From 58aa420b5a0f5e7e5e88f2228f318fb12da5bb13 Mon Sep 17 00:00:00 2001
From: guoxiaoqi2 <guoxiaoqi2@huawei.com>
Date: Tue, 21 Jan 2020 17:59:49 -0500
Subject: [PATCH] fix CVE-2019-19906

Signed-off-by: guoxiaoqi2 <guoxiaoqi2@huawei.com>
---
 lib/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/common.c b/lib/common.c
index 305311d..445c5d5 100644
--- a/lib/common.c
+++ b/lib/common.c
@@ -190,7 +190,7 @@ int _sasl_add_string(char **out, size_t *alloclen,
 
   if (add==NULL) add = "(null)";
 
-  addlen=strlen(add); /* only compute once */
+  addlen=strlen(add)+1; /* only compute once */
   if (_buf_alloc(out, alloclen, (*outlen)+addlen)!=SASL_OK)
     return SASL_NOMEM;
 
-- 
1.8.3.1

