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

Collapse All | Expand All

(-)a/src/dhcp-common.c (-6 / +7 lines)
Lines 645-658 print_option(FILE *fp, const char *prefix, const struct dhcp_opt *opt, Link Here
645
	if (fputc('=', fp) == EOF)
645
	if (fputc('=', fp) == EOF)
646
		return -1;
646
		return -1;
647
	if (dl == 0)
647
	if (dl == 0)
648
		return 1;
648
		goto out;
649
649
650
	if (opt->type & OT_RFC1035) {
650
	if (opt->type & OT_RFC1035) {
651
		char domain[NS_MAXDNAME];
651
		char domain[NS_MAXDNAME];
652
652
653
		sl = decode_rfc1035(domain, sizeof(domain), data, dl);
653
		sl = decode_rfc1035(domain, sizeof(domain), data, dl);
654
		if (sl == 0 || sl == -1)
654
		if (sl == -1)
655
			return sl;
655
			return -1;
656
		if (sl == 0)
657
			goto out;
656
		if (valid_domainname(domain, opt->type) == -1)
658
		if (valid_domainname(domain, opt->type) == -1)
657
			return -1;
659
			return -1;
658
		return efprintf(fp, "%s", domain);
660
		return efprintf(fp, "%s", domain);
Lines 693-701 print_option(FILE *fp, const char *prefix, const struct dhcp_opt *opt, Link Here
693
					return -1;
695
					return -1;
694
			}
696
			}
695
		}
697
		}
696
		if (fputc('\0', fp) == EOF)
698
		goto out;
697
			return -1;
698
		return 1;
699
	}
699
	}
700
700
701
	t = data;
701
	t = data;
Lines 760-765 print_option(FILE *fp, const char *prefix, const struct dhcp_opt *opt, Link Here
760
		}
760
		}
761
	}
761
	}
762
762
763
out:
763
	if (fputc('\0', fp) == EOF)
764
	if (fputc('\0', fp) == EOF)
764
		return -1;
765
		return -1;
765
	return 1;
766
	return 1;
(-)a/src/script.c (-1 / +11 lines)
Lines 33-38 Link Here
33
#include <netinet/in.h>
33
#include <netinet/in.h>
34
#include <arpa/inet.h>
34
#include <arpa/inet.h>
35
35
36
#include <assert.h>
36
#include <ctype.h>
37
#include <ctype.h>
37
#include <errno.h>
38
#include <errno.h>
38
#include <signal.h>
39
#include <signal.h>
Lines 477-488 dumplease: Link Here
477
	fp = NULL;
478
	fp = NULL;
478
#endif
479
#endif
479
480
481
	/* Count the terminated env strings.
482
	 * assert that the terminations are correct. */
480
	nenv = 0;
483
	nenv = 0;
481
	endp = buf + buf_pos;
484
	endp = buf + buf_pos;
482
	for (bufp = buf; bufp < endp; bufp++) {
485
	for (bufp = buf; bufp < endp; bufp++) {
483
		if (*bufp == '\0')
486
		if (*bufp == '\0') {
487
#ifndef NDEBUG
488
			if (bufp + 1 < endp)
489
				assert(*(bufp + 1) != '\0');
490
#endif
484
			nenv++;
491
			nenv++;
492
		}
485
	}
493
	}
494
	assert(*--bufp == '\0');
495
486
	if (ctx->script_envlen < nenv) {
496
	if (ctx->script_envlen < nenv) {
487
		env = reallocarray(ctx->script_env, nenv + 1, sizeof(*env));
497
		env = reallocarray(ctx->script_env, nenv + 1, sizeof(*env));
488
		if (env == NULL)
498
		if (env == NULL)

Return to bug 691426