Module Name: src
Committed By: stacktic
Date: Sun Dec 15 21:48:56 UTC 2013
Modified Files:
src/dist/smbfs/lib/smb: nb_name.c
Log Message:
nb_name_len does not increase size when nn_scope contains only a \0,
do the same on nb_name_encode to avoid a buffer overflow
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/dist/smbfs/lib/smb/nb_name.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/dist/smbfs/lib/smb/nb_name.c
diff -u src/dist/smbfs/lib/smb/nb_name.c:1.6 src/dist/smbfs/lib/smb/nb_name.c:1.7
--- src/dist/smbfs/lib/smb/nb_name.c:1.6 Sun Dec 15 21:45:07 2013
+++ src/dist/smbfs/lib/smb/nb_name.c Sun Dec 15 21:48:55 2013
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: nb_name.c,v 1.6 2013/12/15 21:45:07 stacktic Exp $");
+__RCSID("$NetBSD: nb_name.c,v 1.7 2013/12/15 21:48:55 stacktic Exp $");
#include <sys/param.h>
#include <sys/socket.h>
@@ -183,7 +183,7 @@ nb_name_encode(struct nb_name *np, u_cha
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;