BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000669 [uClibc] Networking Support minor always 01-30-06 19:04 06-02-08 20:04
Reporter rfelker View Status public  
Assigned To uClibc
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0000669: gethostbyaddr null pointer in he->h_aliases
Description uClibc puts a null pointer in he->h_aliases on gethostbyaddr. POSIX is
unclear on what should be done, but since the he->h_aliases list is
supposed to be null-terminated it seems that he->h_aliases itself
should not be a null pointer.

Other implementations seem to put a zero-length list of pointers.
Additional Information I found this because it caused my test program to crash. :) Maybe it will cause other programs to crash too..?
Attached Files

- Relationships

- Notes
(0001022)
rfelker
01-30-06 19:15

Category should be Standards Compliance.
 
(0008014)
vda
06-02-08 20:03
edited on: 06-02-08 20:04

Test prog:

#include <sys/socket.h>
#include <netdb.h>
int main() {
        in_addr_t addr = inet_addr("127.0.0.1");
        struct hostent *r = gethostbyaddr(&addr, sizeof(addr), AF_INET);

        printf("r = %p\n", r);
        printf("r->h_name = '%s'\n", r->h_name);
        printf("r->h_addrtype = %d\n", r->h_addrtype);
        printf("r->h_length = %d\n", r->h_length);
        //printf("r->h_addr_list = '%s'\n", r->h_addr_list);
        printf("r->h_aliases = %p\n", r->h_aliases);
        if (r->h_aliases) {
                printf("r->h_aliases[0] = '%s'\n", r->h_aliases[0]);
                printf("r->h_aliases[1] = '%s'\n", r->h_aliases[1]);
        }
        return 0;
}

Output:

r = 0x8050008
r->h_name = 'localhost'
r->h_addrtype = 2
r->h_length = 4
r->h_aliases = 0x8050024
r->h_aliases[0] = '(null)'
r->h_aliases[1] = '(null)'

 
(0008024)
vda
06-02-08 20:04

Seems to be already fixed.
 

- Issue History
Date Modified Username Field Change
01-30-06 19:04 rfelker New Issue
01-30-06 19:04 rfelker Status new => assigned
01-30-06 19:04 rfelker Assigned To  => uClibc
01-30-06 19:15 rfelker Note Added: 0001022
02-18-06 11:49 vapier Category Math Library => Networking Support
06-02-08 20:03 vda Note Added: 0008014
06-02-08 20:04 vda Note Edited: 0008014
06-02-08 20:04 vda Status assigned => closed
06-02-08 20:04 vda Note Added: 0008024
06-02-08 20:04 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker