Changeset 22 for trunk/src/sh_mail.c
- Timestamp:
- Feb 23, 2006, 12:03:58 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_mail.c
r20 r22 271 271 272 272 static 273 int sh_filter_filteradd (char * argstring, sh_filter_type * filter, int ftype) 273 int sh_filter_filteradd (const char * argstring, 274 sh_filter_type * filter, int ftype) 274 275 { 275 276 int i = 0; … … 372 373 */ 373 374 static 374 int sh_filter_filter (c har * message, sh_filter_type * filter)375 int sh_filter_filter (const char * message, sh_filter_type * filter) 375 376 { 376 377 int i; … … 432 433 * -- add keywords to the OR filter 433 434 */ 434 int sh_mail_add_or (c har * str)435 int sh_mail_add_or (const char * str) 435 436 { 436 437 return (sh_filter_filteradd (str, &(mail_filter), SH_FILT_OR)); … … 440 441 * -- add keywords to the AND filter 441 442 */ 442 int sh_mail_add_and (c har * str)443 int sh_mail_add_and (const char * str) 443 444 { 444 445 return (sh_filter_filteradd (str, &(mail_filter), SH_FILT_AND)); … … 448 449 * -- add keywords to the NOT filter 449 450 */ 450 int sh_mail_add_not (c har * str)451 int sh_mail_add_not (const char * str) 451 452 { 452 453 return (sh_filter_filteradd (str, &(mail_filter), SH_FILT_NOT)); … … 473 474 } 474 475 475 int sh_mail_setaddress (c har * address)476 int sh_mail_setaddress (const char * address) 476 477 { 477 478 char * p; … … 523 524 } 524 525 525 int sh_mail_setaddress_int (c har * address)526 int sh_mail_setaddress_int (const char * address) 526 527 { 527 528 int i; … … 533 534 } 534 535 535 int sh_mail_setNum (c har * str)536 int sh_mail_setNum (const char * str) 536 537 { 537 538 int i = atoi (str); … … 549 550 static int all_in_one = S_FALSE; 550 551 551 int sh_mail_setFlag (c har * str)552 int sh_mail_setFlag (const char * str) 552 553 { 553 554 int i; … … 559 560 static char * mail_subject = NULL; 560 561 561 int set_mail_subject (c har * str)562 int set_mail_subject (const char * str) 562 563 { 563 564 SL_ENTER(_("set_mail_subject")); … … 1006 1007 /* reveal first signature key 1007 1008 */ 1008 (void) sl_strlcpy(skey->crypt, skey->mailkey_new, KEY_LEN+1); 1009 /* flawfinder: ignore */ 1010 (void) sl_strlcpy(skey->crypt, skey->mailkey_new, KEY_LEN+1); 1009 1011 1010 1012 BREAKEXIT(sh_util_encode); 1013 /* flawfinder: ignore */ 1011 1014 sh_util_encode(skey->crypt, bufcompress, 0, 'A'); 1012 1015 1016 /* flawfinder: ignore */ 1013 1017 (void) sl_strlcat (mailMsg, skey->crypt, msgbufsize); 1018 /* flawfinder: ignore */ 1014 1019 memset (skey->crypt, 0, KEY_LEN); 1015 1020 isfirst = 0; … … 1021 1026 (void) sl_strlcpy (skey->mailkey_old, skey->mailkey_new, KEY_LEN+1); 1022 1027 1023 /*@-bufferoverflowhigh@*/ 1024 sprintf(subject, _("%06d %010ld::%s\r\n"), /* known to fit */ 1025 mailcount, (long) id_audit, sh.host.name); 1026 /*@+bufferoverflowhigh@*/ 1028 sl_snprintf(subject, sizeof(subject), _("%06d %010ld::%s\r\n"), 1029 mailcount, (long) id_audit, sh.host.name); 1027 1030 1028 1031 (void) sl_strlcat (mailMsg, subject, msgbufsize); … … 1222 1225 static char * relay_host = NULL; 1223 1226 1224 int sh_mail_set_relay (c har * str_s)1227 int sh_mail_set_relay (const char * str_s) 1225 1228 { 1226 1229 size_t i = 0; … … 1251 1254 static char * mail_sender = NULL; 1252 1255 1253 int sh_mail_set_sender (c har *str)1256 int sh_mail_set_sender (const char *str) 1254 1257 { 1255 1258 if (mail_sender != NULL) … … 1735 1738 if (g != 1) 1736 1739 { 1737 /*@-bufferoverflowhigh@*/ 1738 sprintf(errmsg, /* known to fit */ 1739 _("Bad response (%d), expected %d"), rcode, code); 1740 /*@+bufferoverflowhigh@*/ 1740 sl_snprintf(errmsg, sizeof(errmsg), 1741 _("Bad response (%d), expected %d"), rcode, code); 1742 1741 1743 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_NET, 1742 1744 errmsg, _("sh_mail_wait"), … … 1883 1885 int ret, length, status; 1884 1886 mx * result; 1887 size_t len; 1885 1888 1886 1889 typedef union … … 2065 2068 */ 2066 2069 result[count].pref = pref; 2067 result[count].address = SH_ALLOC (strlen (expanded) + 1); 2068 strcpy (result[count].address, expanded); /* known to fit */ 2070 len = strlen (expanded) + 1; 2071 result[count].address = SH_ALLOC (len); 2072 sl_strlcpy (result[count].address, expanded, len); 2069 2073 } 2070 2074 while (ret > 0 && comp_dn < eom && count); … … 2101 2105 mx * result; 2102 2106 dnsrep * retval; 2103 char errmsg[128]; 2107 char errmsg[128]; 2108 size_t len; 2104 2109 2105 2110 SL_ENTER(_("return_mx")); … … 2128 2133 _("get_mx")); 2129 2134 #else 2135 /* flawfinder: ignore *//* test code only */ 2130 2136 strcpy (errmsg, /* known to fit */ 2131 2137 _("No MX record for domain ")); … … 2155 2161 result->pref = 0; 2156 2162 /*@-type@*/ 2157 result->address = SH_ALLOC (strlen (host->h_name) + 1); 2158 strcpy (result->address, host->h_name); /* known to fit */ 2163 len = strlen (host->h_name) + 1; 2164 result->address = SH_ALLOC (len); 2165 sl_strlcpy (result->address, host->h_name, len); 2159 2166 /*@+type@*/ 2160 2167 SL_RETURN (retval, _("return_mx"));
Note:
See TracChangeset
for help on using the changeset viewer.