s4:winsserver: reject name registrations with a scope length > 237
[abartlet/samba.git/.git] / source4 / nbt_server / wins / winsserver.c
index 4b8b8cc137aa5f0ddcfd00908f12368d61882440..ca8daedc66f5e788efb848d4352ccdf8d0eab663 100644 (file)
@@ -496,6 +496,11 @@ static void nbtd_winsserver_register(struct nbt_name_socket *nbtsock,
                goto done;
        }
 
+       if (name->scope && strlen(name->scope) > 237) {
+               rcode = NBT_RCODE_SVR;
+               goto done;
+       }
+
        duplicate_packet = wins_check_wack_queue(iface, packet, src);
        if (duplicate_packet) {
                /* just ignore the packet */
@@ -874,6 +879,10 @@ static void nbtd_winsserver_release(struct nbt_name_socket *nbtsock,
                goto done;
        }
 
+       if (name->scope && strlen(name->scope) > 237) {
+               goto done;
+       }
+
        status = winsdb_lookup(winssrv->wins_db, name, packet, &rec);
        if (!NT_STATUS_IS_OK(status)) {
                goto done;