VirtualBox

Changeset 18872 in vbox


Ignore:
Timestamp:
Apr 11, 2009 9:48:52 PM (16 years ago)
Author:
vboxsync
Message:

slirp.c: empty strings still takes at least 1 byte of heap, don't leak it. Also, deal with RTUtf16ToUtf8 failure (it will set suffix to NULL) the same way as empty DNS strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r18865 r18872  
    407407            /*uniq*/
    408408            RTUtf16ToUtf8(addr->DnsSuffix, &suffix);
    409            
    410             if (strlen(suffix) == 0) {
     409
     410            if (!suffix || strlen(suffix) == 0) {
    411411                /* dhcpcd client very sad if no domain name is passed */
     412                RTStrFree(suffix);
    412413                if (fzerro_len_added)
    413414                    goto next_dns;
    414                 fzerro_len_added = 1; 
     415                fzerro_len_added = 1;
    415416                suffix = RTStrDup(" ");
    416417            }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette