Deleted Added
full compact
headers.c (71348) headers.c (73191)
1/*
1/*
2 * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers.
2 * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 */
13
14#ifndef lint
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 */
13
14#ifndef lint
15static char id[] = "@(#)$Id: headers.c,v 8.203.4.10 2000/10/13 17:54:30 gshapiro Exp $";
15static char id[] = "@(#)$Id: headers.c,v 8.203.4.12 2001/01/22 19:00:22 gshapiro Exp $";
16#endif /* ! lint */
17
16#endif /* ! lint */
17
18/* $FreeBSD: head/contrib/sendmail/src/headers.c 71348 2001-01-21 22:21:43Z gshapiro $ */
18/* $FreeBSD: head/contrib/sendmail/src/headers.c 73191 2001-02-28 00:22:47Z gshapiro $ */
19
20#include <sendmail.h>
21
22static size_t fix_mime_header __P((char *));
23static int priencode __P((char *));
24static void put_vanilla_header __P((HDR *, char *, MCI *));
25
26/*

--- 278 unchanged lines hidden (view full) ---

305 int l;
306 char qval[MAXNAME];
307 char hlen[16];
308 char *sp, *dp;
309
310 dp = qval;
311 l = 0;
312 dp[l++] = '"';
19
20#include <sendmail.h>
21
22static size_t fix_mime_header __P((char *));
23static int priencode __P((char *));
24static void put_vanilla_header __P((HDR *, char *, MCI *));
25
26/*

--- 278 unchanged lines hidden (view full) ---

305 int l;
306 char qval[MAXNAME];
307 char hlen[16];
308 char *sp, *dp;
309
310 dp = qval;
311 l = 0;
312 dp[l++] = '"';
313 for (sp = fvalue; *sp != '\0' && l < MAXNAME - 2; sp++)
313 for (sp = fvalue; *sp != '\0' && l < MAXNAME - 3; sp++)
314 {
315 switch(*sp)
316 {
317 case '\011': /* ht */
318 case '\012': /* nl */
319 case '\013': /* vt */
320 case '\014': /* np */
321 case '\015': /* cr */

--- 12 unchanged lines hidden (view full) ---

334 l = strlen(fvalue);
335 snprintf(hlen, sizeof hlen, "%d", l);
336 define(macid("{hdrlen}", NULL), newstr(hlen), e);
337 if (l >= MAXNAME)
338 {
339 if (LogLevel > 9)
340 sm_syslog(LOG_WARNING, e->e_id,
341 "Warning: truncated header '%s' before check with '%s' len=%d max=%d",
314 {
315 switch(*sp)
316 {
317 case '\011': /* ht */
318 case '\012': /* nl */
319 case '\013': /* vt */
320 case '\014': /* np */
321 case '\015': /* cr */

--- 12 unchanged lines hidden (view full) ---

334 l = strlen(fvalue);
335 snprintf(hlen, sizeof hlen, "%d", l);
336 define(macid("{hdrlen}", NULL), newstr(hlen), e);
337 if (l >= MAXNAME)
338 {
339 if (LogLevel > 9)
340 sm_syslog(LOG_WARNING, e->e_id,
341 "Warning: truncated header '%s' before check with '%s' len=%d max=%d",
342 fname, rs, l, MAXNAME);
342 fname, rs, l, MAXNAME - 1);
343 }
344 if ((sp = macvalue(macid("{currHeader}", NULL), e)) !=
345 NULL)
346 free(sp);
347 define(macid("{currHeader}", NULL), newstr(qval), e);
348 define(macid("{hdr_name}", NULL), newstr(fname), e);
349 (void) rscheck(rs, fvalue, NULL, e, stripcom, TRUE, 4,
350 NULL);

--- 1543 unchanged lines hidden ---
343 }
344 if ((sp = macvalue(macid("{currHeader}", NULL), e)) !=
345 NULL)
346 free(sp);
347 define(macid("{currHeader}", NULL), newstr(qval), e);
348 define(macid("{hdr_name}", NULL), newstr(fname), e);
349 (void) rscheck(rs, fvalue, NULL, e, stripcom, TRUE, 4,
350 NULL);

--- 1543 unchanged lines hidden ---