Modified fix for bugid #784. Based on a patch from moriyama@miraclelinux.com (MORIYAM...
[samba.git] / source3 / nmbd / nmbd_winsproxy.c
index bace112752f7071261be7f9f82d27daa68c66f1d..d91818698e87b1602118d14281d8588b615b3853 100644 (file)
@@ -30,7 +30,7 @@ static void wins_proxy_name_query_request_success( struct subnet_record *subrec,
                         struct userdata_struct *userdata,
                         struct nmb_name *nmbname, struct in_addr ip, struct res_rec *rrec)
 {
-       nstring name;
+       fstring name;
        struct packet_struct *original_packet;
        struct subnet_record *orig_broadcast_subnet;
        struct name_record *namerec;
@@ -73,7 +73,7 @@ returned for name %s.\n", nmb_namestr(nmbname) ));
        if(rrec == PERMANENT_TTL)
                ttl = lp_max_ttl();
 
-       pull_ascii_nstring(name, nmbname->name);
+       pull_ascii_nstring(name, sizeof(name), nmbname->name);
        namerec = add_name_to_subnet( orig_broadcast_subnet, name,
                                        nmbname->name_type, nb_flags, ttl,
                                        WINS_PROXY_NAME, num_ips, iplist );
@@ -193,7 +193,7 @@ void make_wins_proxy_name_query_request( struct subnet_record *subrec,
        long *ud[(sizeof(struct userdata_struct) + sizeof(struct subrec *) + 
                sizeof(struct packet_struct *))/sizeof(long *) + 1];
        struct userdata_struct *userdata = (struct userdata_struct *)ud;
-       nstring qname;
+       fstring qname;
 
        memset(ud, '\0', sizeof(ud));
  
@@ -205,7 +205,7 @@ void make_wins_proxy_name_query_request( struct subnet_record *subrec,
                        sizeof(struct packet_struct *));
 
        /* Now use the unicast subnet to query the name with the WINS server. */
-       pull_ascii_nstring(qname, question_name->name);
+       pull_ascii_nstring(qname, sizeof(qname), question_name->name);
        query_name( unicast_subnet, qname, question_name->name_type,
                wins_proxy_name_query_request_success,
                wins_proxy_name_query_request_fail,