Skip to content

Commit

Permalink
Make sure we keep enough space to encode the type
Browse files Browse the repository at this point in the history
  • Loading branch information
stacktic committed Dec 13, 2013
1 parent 7a04b33 commit 07001e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/smb/nb_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 07001e9

Please sign in to comment.