summaryrefslogtreecommitdiffstats
path: root/nsswitch/wins.c
diff options
context:
space:
mode:
Diffstat (limited to 'nsswitch/wins.c')
-rw-r--r--nsswitch/wins.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/nsswitch/wins.c b/nsswitch/wins.c
index d63968b2bc..5127ee479f 100644
--- a/nsswitch/wins.c
+++ b/nsswitch/wins.c
@@ -59,10 +59,12 @@ static void nss_wins_init(void)
static struct in_addr *lookup_byname_backend(const char *name, int *count)
{
- TALLOC_CTX *frame = talloc_stackframe();
+ TALLOC_CTX *frame;
struct sockaddr_storage *address = NULL;
struct in_addr *ret = NULL;
NTSTATUS status;
+ const char *p;
+ size_t nbt_len;
int j;
if (!initialised) {
@@ -71,6 +73,16 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count)
*count = 0;
+ nbt_len = strlen(name);
+ if (nbt_len > MAX_NETBIOSNAME_LEN - 1) {
+ return NULL;
+ }
+ p = strchr(name, '.');
+ if (p != NULL) {
+ return NULL;
+ }
+
+ frame = talloc_stackframe();
/* always try with wins first */
status = resolve_wins(name, 0x00, talloc_tos(),
&address, count);