summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/nmbd/nmbd_sendannounce.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/nmbd/nmbd_sendannounce.c b/source3/nmbd/nmbd_sendannounce.c
index 6e50d2f2ff..a74dd99196 100644
--- a/source3/nmbd/nmbd_sendannounce.c
+++ b/source3/nmbd/nmbd_sendannounce.c
@@ -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. */