Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!decwrl!bacchus.pa.dec.com!vixie From: vixie@decwrl.dec.com (Paul A Vixie) Newsgroups: comp.mail.sendmail Subject: another fixed-length buffer in sendmail Message-ID: Date: 19 Jul 90 18:16:25 GMT Sender: news@wrl.dec.com (News) Organization: DEC Western Research Lab Lines: 35 All production software should be written in a real language. *** /tmp/,RCSt1a06099 Thu Jul 19 14:14:59 1990 --- savemail.c Thu Jul 19 13:58:29 1990 *************** *** 416,425 **** break; if (p == q) { /* No, add it */ *to++ = ','; *to++ = ' '; - len = strlen(q->q_paddr); if (q->q_paddr[0] == '<' && q->q_paddr[len-1] == '>' && q->q_paddr[1] != '@') { /* Remove angle brackets; they aren't needed */ --- 416,429 ---- break; if (p == q) { /* No, add it */ + len = strlen(q->q_paddr); + + if (to+2+len+1 >= buf + sizeof buf) + break; + *to++ = ','; *to++ = ' '; if (q->q_paddr[0] == '<' && q->q_paddr[len-1] == '>' && q->q_paddr[1] != '@') { /* Remove angle brackets; they aren't needed */ -- Paul Vixie DEC Western Research Lab Palo Alto, California ...!decwrl!vixie