This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/6942] Unaligned access in resolv


------- Additional Comments From hjl dot tools at gmail dot com  2008-10-07 18:04 -------
In res_send.c, there are

                    && anscp
                    && (ioctl (pfd[0].fd, FIONREAD, thisresplenp) < 0
                        || *thisanssizp < *thisresplenp)) {
                        u_char *newp = malloc (MAXPACKET);
                        if (newp != NULL) {
                                *anssizp = MAXPACKET;
                                *thisansp = ans = newp;
                        }
                }
                HEADER *anhp = (HEADER *) *thisansp;


        if (__builtin_expect (statp->qhook || statp->rhook, 0)) {
                if (anssiz < MAXPACKET && ansp) {
                        u_char *buf = malloc (MAXPACKET);
                        if (buf == NULL)
                                return (-1);
                        memcpy (buf, ans, HFIXEDSZ);
                        *ansp = buf;
                        ans = buf;
                        anssiz = MAXPACKET;
                }
        }

                if (__builtin_expect (anscp != NULL, 1)) {
                        u_char *newp = malloc (MAXPACKET);
                        if (newp == NULL) {
                                *terrno = ENOMEM;
                                __res_iclose(statp, false);
                                return (0);
                        }
                        *thisanssizp = MAXPACKET;
                        *thisansp = newp;
                        anhp = (HEADER *) newp;
                        len = rlen;

Are they properly aligned?

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6942

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]