1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

s3-util: Compare the maximum allowed length of a NetBIOS name

This fixes a problem where is_myname() returns true if one of our names
is a substring of the specified name.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11427

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Roel van Meer 2015-08-04 16:50:43 +02:00 committed by Jeremy Allison
parent dcc657a221
commit 4e178ed498

View File

@ -1198,7 +1198,7 @@ bool is_myname(const char *s)
for (n=0; my_netbios_names(n); n++) {
const char *nbt_name = my_netbios_names(n);
if (strncasecmp_m(nbt_name, s, strlen(nbt_name)) == 0) {
if (strncasecmp_m(nbt_name, s, MAX_NETBIOSNAME_LEN-1) == 0) {
ret=True;
break;
}