From 07001e9bfaca9796e31e49ffbeb1220d19cc2b64 Mon Sep 17 00:00:00 2001 From: Arnaud Ysmal Date: Fri, 13 Dec 2013 19:35:59 +0100 Subject: [PATCH] Make sure we keep enough space to encode the type --- lib/smb/nb_name.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/smb/nb_name.c b/lib/smb/nb_name.c index c15663b..8323e3a 100644 --- a/lib/smb/nb_name.c +++ b/lib/smb/nb_name.c @@ -168,7 +168,7 @@ nb_name_encode(struct nb_name *np, u_char *dst) memsetw(cp + 2, NB_NAMELEN - 1, NBENCODE(' ')); cp += NB_ENCNAMELEN; } else { - for (i = 0; *name && i < NB_NAMELEN; i++, cp += 2, name++) { + for (i = 0; *name && i < NB_NAMELEN - 1; i++, cp += 2, name++) { ch = NBENCODE(toupper(*name)); memcpy(cp, &ch, 2); }