Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 234391 | Differences between
and this patch

Collapse All | Expand All

(-)ssmtp-original/ssmtp.c (-27 / +32 lines)
Lines 55-75 Link Here
55
55
56
#define ARPADATE_LENGTH 32		/* Current date in RFC format */
56
#define ARPADATE_LENGTH 32		/* Current date in RFC format */
57
char arpadate[ARPADATE_LENGTH];
57
char arpadate[ARPADATE_LENGTH];
58
char *auth_user = (char)NULL;
58
char *auth_user = (char *)NULL;
59
char *auth_pass = (char)NULL;
59
char *auth_pass = (char *)NULL;
60
char *auth_method = (char)NULL;		/* Mechanism for SMTP authentication */
60
char *auth_method = (char *)NULL;		/* Mechanism for SMTP authentication */
61
char *mail_domain = (char)NULL;
61
char *mail_domain = (char *)NULL;
62
char *from = (char)NULL;		/* Use this as the From: address */
62
char *from = (char *)NULL;		/* Use this as the From: address */
63
char *hostname;
63
char *hostname;
64
char *mailhost = "mailhub";
64
char *mailhost = "mailhub";
65
char *minus_f = (char)NULL;
65
char *minus_f = (char *)NULL;
66
char *minus_F = (char)NULL;
66
char *minus_F = (char *)NULL;
67
char *gecos;
67
char *gecos;
68
char *prog = (char)NULL;
68
char *prog = (char *)NULL;
69
char *root = NULL;
69
char *root = NULL;
70
char *tls_cert = "/etc/ssl/certs/ssmtp.pem";	/* Default Certificate */
70
char *tls_cert = "/etc/ssl/certs/ssmtp.pem";	/* Default Certificate */
71
char *uad = (char)NULL;
71
char *uad = (char *)NULL;
72
char *config_file = (char)NULL;		/* alternate configuration file */
72
char *config_file = (char *)NULL;		/* alternate configuration file */
73
73
74
headers_t headers, *ht;
74
headers_t headers, *ht;
75
75
Lines 261-267 Link Here
261
261
262
	p = (str + strlen(str));
262
	p = (str + strlen(str));
263
	while(isspace(*--p)) {
263
	while(isspace(*--p)) {
264
		*p = (char)NULL;
264
		*p = '\0';
265
	}
265
	}
266
266
267
	return(p);
267
	return(p);
Lines 287-293 Link Here
287
		q++;
287
		q++;
288
288
289
		if((p = strchr(q, '>'))) {
289
		if((p = strchr(q, '>'))) {
290
			*p = (char)NULL;
290
			*p = '\0';
291
		}
291
		}
292
292
293
#if 0
293
#if 0
Lines 310-316 Link Here
310
	q = strip_post_ws(p);
310
	q = strip_post_ws(p);
311
	if(*q == ')') {
311
	if(*q == ')') {
312
		while((*--q != '('));
312
		while((*--q != '('));
313
		*q = (char)NULL;
313
		*q = '\0';
314
	}
314
	}
315
	(void)strip_post_ws(p);
315
	(void)strip_post_ws(p);
316
316
Lines 353-359 Link Here
353
	char *p;
353
	char *p;
354
354
355
	if((p = strchr(str, '\n'))) {
355
	if((p = strchr(str, '\n'))) {
356
		*p = (char)NULL;
356
		*p = '\0';
357
	}
357
	}
358
358
359
	/* Any line beginning with a dot has an additional dot inserted;
359
	/* Any line beginning with a dot has an additional dot inserted;
Lines 386-392 Link Here
386
		while(fgets(buf, sizeof(buf), fp)) {
386
		while(fgets(buf, sizeof(buf), fp)) {
387
			/* Make comments invisible */
387
			/* Make comments invisible */
388
			if((p = strchr(buf, '#'))) {
388
			if((p = strchr(buf, '#'))) {
389
				*p = (char)NULL;
389
				*p = '\0';
390
			}
390
			}
391
391
392
			/* Ignore malformed lines and comments */
392
			/* Ignore malformed lines and comments */
Lines 485-490 Link Here
485
				die("from_format() -- snprintf() failed");
485
				die("from_format() -- snprintf() failed");
486
			}
486
			}
487
		}
487
		}
488
		else {
489
			if(snprintf(buf, BUF_SZ, "%s", str) == -1) {
490
				die("from_format() -- snprintf() failed");
491
			}
492
		}
488
	}
493
	}
489
494
490
#if 0
495
#if 0
Lines 516-522 Link Here
516
#endif
521
#endif
517
522
518
	/* Ignore missing usernames */
523
	/* Ignore missing usernames */
519
	if(*str == (char)NULL) {
524
	if(*str == '\0') {
520
		return;
525
		return;
521
	}
526
	}
522
527
Lines 573-579 Link Here
573
		}
578
		}
574
579
575
		/* End of string? */
580
		/* End of string? */
576
		if(*(q + 1) == (char)NULL) {
581
		if(*(q + 1) == '\0') {
577
			got_addr = True;
582
			got_addr = True;
578
		}
583
		}
579
584
Lines 581-587 Link Here
581
		if((*q == ',') && (in_quotes == False)) {
586
		if((*q == ',') && (in_quotes == False)) {
582
			got_addr = True;
587
			got_addr = True;
583
588
584
			*q = (char)NULL;
589
			*q = '\0';
585
		}
590
		}
586
591
587
		if(got_addr) {
592
		if(got_addr) {
Lines 673-679 Link Here
673
	if(strncasecmp(ht->string, "From:", 5) == 0) {
678
	if(strncasecmp(ht->string, "From:", 5) == 0) {
674
#if 1
679
#if 1
675
		/* Hack check for NULL From: line */
680
		/* Hack check for NULL From: line */
676
		if(*(p + 6) == (char)NULL) {
681
		if(*(p + 6) == '\0') {
677
			return;
682
			return;
678
		}
683
		}
679
#endif
684
#endif
Lines 738-744 Link Here
738
	size_t size = BUF_SZ, len = 0;
743
	size_t size = BUF_SZ, len = 0;
739
	char *p = (char *)NULL, *q;
744
	char *p = (char *)NULL, *q;
740
	bool_t in_header = True;
745
	bool_t in_header = True;
741
	char l = (char)NULL;
746
	char l = '\0';
742
	int c;
747
	int c;
743
748
744
	while(in_header && ((c = fgetc(stream)) != EOF)) {
749
	while(in_header && ((c = fgetc(stream)) != EOF)) {
Lines 773-781 Link Here
773
						in_header = False;
778
						in_header = False;
774
779
775
				default:
780
				default:
776
						*q = (char)NULL;
781
						*q = '\0';
777
						if((q = strrchr(p, '\n'))) {
782
						if((q = strrchr(p, '\n'))) {
778
							*q = (char)NULL;
783
							*q = '\0';
779
						}
784
						}
780
						header_save(p);
785
						header_save(p);
781
786
Lines 806-814 Link Here
806
						in_header = False;
811
						in_header = False;
807
812
808
				default:
813
				default:
809
						*q = (char)NULL;
814
						*q = '\0';
810
						if((q = strrchr(p, '\n'))) {
815
						if((q = strrchr(p, '\n'))) {
811
							*q = (char)NULL;
816
							*q = '\0';
812
						}
817
						}
813
						header_save(p);
818
						header_save(p);
814
819
Lines 882-888 Link Here
882
		char *rightside;
887
		char *rightside;
883
		/* Make comments invisible */
888
		/* Make comments invisible */
884
		if((p = strchr(buf, '#'))) {
889
		if((p = strchr(buf, '#'))) {
885
			*p = (char)NULL;
890
			*p = '\0';
886
		}
891
		}
887
892
888
		/* Ignore malformed lines and comments */
893
		/* Ignore malformed lines and comments */
Lines 1310-1316 Link Here
1310
			buf[i++] = c;
1315
			buf[i++] = c;
1311
		}
1316
		}
1312
	}
1317
	}
1313
	buf[i] = (char)NULL;
1318
	buf[i] = '\0';
1314
1319
1315
	return(buf);
1320
	return(buf);
1316
}
1321
}
Lines 1723-1729 Link Here
1723
		j = 0;
1728
		j = 0;
1724
1729
1725
		add = 1;
1730
		add = 1;
1726
		while(argv[i][++j] != (char)NULL) {
1731
		while(argv[i][++j] != '\0') {
1727
			switch(argv[i][j]) {
1732
			switch(argv[i][j]) {
1728
#ifdef INET6
1733
#ifdef INET6
1729
			case '6':
1734
			case '6':

Return to bug 234391