diff options
author | Andreas Schneider <asn@samba.org> | 2015-01-30 14:37:06 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-02-24 01:01:10 +0100 |
commit | 84d4270c8e4ec18e9f83722d6df1a07f70acaade (patch) | |
tree | df746b64b7d84795bd7a445ccd8d1013fc9df814 /source3 | |
parent | a782ae1da463433b6f5199acd0d093583780dd20 (diff) | |
download | samba-84d4270c8e4ec18e9f83722d6df1a07f70acaade.tar.gz samba-84d4270c8e4ec18e9f83722d6df1a07f70acaade.tar.xz samba-84d4270c8e4ec18e9f83722d6df1a07f70acaade.zip |
nmblookup: Warn user if netbios name is too long.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb 24 01:01:10 CET 2015 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/nmblookup.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c index 78548e9d68..a119b3eabe 100644 --- a/source3/utils/nmblookup.c +++ b/source3/utils/nmblookup.c @@ -320,6 +320,7 @@ int main(int argc, const char *argv[]) while(poptPeekArg(pc)) { char *p; struct in_addr ip; + size_t nbt_len; fstrcpy(lookup,poptGetArg(pc)); @@ -349,6 +350,14 @@ int main(int argc, const char *argv[]) sscanf(++p,"%x",&lookup_type); } + nbt_len = strlen(lookup); + if (nbt_len > MAX_NETBIOSNAME_LEN - 1) { + d_printf("The specified netbios name [%s] is too long!\n", + lookup); + continue; + } + + if (!query_one(lookup, lookup_type)) { rc = 1; d_printf( "name_query failed to find name %s", lookup ); |