1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-29 13:49:30 +03:00

Avoid mb conversion overflow when sending an announcement.

Jeremy.
(This used to be commit 188e1daaff)
This commit is contained in:
Jeremy Allison
2004-03-16 00:10:30 +00:00
parent ce0c99312c
commit 96c5a010bb

View File

@ -92,6 +92,7 @@ static void send_announcement(struct subnet_record *subrec, int announce_type,
const char *server_name, int server_type, const char *server_comment)
{
pstring outbuf;
unstring upper_server_name;
char *p;
memset(outbuf,'\0',sizeof(outbuf));
@ -103,7 +104,9 @@ static void send_announcement(struct subnet_record *subrec, int announce_type,
SCVAL(p,0,updatecount);
SIVAL(p,1,announce_interval*1000); /* Milliseconds - despite the spec. */
push_string(NULL, p+5, server_name, 15, STR_ASCII|STR_UPPER|STR_TERMINATE);
safe_strcpy(upper_server_name, server_name, sizeof(upper_server_name)-1);
strupper_m(upper_server_name);
push_string(NULL, p+5, upper_server_name, 16, STR_ASCII|STR_TERMINATE);
SCVAL(p,21,lp_major_announce_version()); /* Major version. */
SCVAL(p,22,lp_minor_announce_version()); /* Minor version. */