Skip to content

Commit

Permalink
nb_name_len does not increase size when nn_scope contains only a \0, …
Browse files Browse the repository at this point in the history
…do the same on nb_name_encode to avoid a buffer overflow
  • Loading branch information
stacktic committed Dec 13, 2013
1 parent 07001e9 commit 6c44bdb
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 @@ -182,7 +182,7 @@ nb_name_encode(struct nb_name *np, u_char *dst)
cp += 2;
}
*cp = 0;
if (np->nn_scope == NULL)
if (np->nn_scope == NULL || *np->nn_scope == 0)
return nb_encname_len(dst);
plen = cp++;
lblen = 0;
Expand Down

0 comments on commit 6c44bdb

Please sign in to comment.