diff options
author | kensmith <kensmith@FreeBSD.org> | 2007-12-24 00:43:11 +0000 |
---|---|---|
committer | kensmith <kensmith@FreeBSD.org> | 2007-12-24 00:43:11 +0000 |
commit | 8c3947d45bc4890bd2a49e14ab7df4457e845dfe (patch) | |
tree | d22ac93eaa72a096b068c32c1d26731c1cfe2455 /usr.sbin/sysinstall/index.c | |
parent | cf2788b7693368d77b73809ca5528473d2fb09ba (diff) | |
download | FreeBSD-src-8c3947d45bc4890bd2a49e14ab7df4457e845dfe.zip FreeBSD-src-8c3947d45bc4890bd2a49e14ab7df4457e845dfe.tar.gz |
For the INDEX file to be used on disc1 of the 7.0-RELEASE the longest
"build dependencies" field is 5,108 characters which overflows the
length of the junk buffer by a teeny bit. This whole section needs
much more error checking but for now just completely ignore stuff
we have no interest in instead of copying it to someplace we don't
use in the process.
Insta-MFC probably coming since this is holding up 7.0-RC1...
Diffstat (limited to 'usr.sbin/sysinstall/index.c')
-rw-r--r-- | usr.sbin/sysinstall/index.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/usr.sbin/sysinstall/index.c b/usr.sbin/sysinstall/index.c index 1dd7913..7a9443a 100644 --- a/usr.sbin/sysinstall/index.c +++ b/usr.sbin/sysinstall/index.c @@ -270,6 +270,18 @@ copy_to_sep(char *to, char *from, int sep) } static int +skip_to_sep(char *from, int sep) +{ + char *tok; + + tok = strchr(from, sep); + if (!tok) + return 0; + *tok = '\0'; + return tok + 1 - from; +} + +static int readline(FILE *fp, char *buf, int max) { int rv, i = 0; @@ -307,21 +319,21 @@ index_parse(FILE *fp, char *name, char *pathto, char *prefix, char *comment, cha cp += copy_to_sep(descr, cp, '|'); /* path to pkg-descr */ cp += copy_to_sep(maint, cp, '|'); /* maintainer */ cp += copy_to_sep(cats, cp, '|'); /* categories */ - cp += copy_to_sep(junk, cp, '|'); /* build deps - not used */ + cp += skip_to_sep(cp, '|'); /* build deps - not used */ cp += copy_to_sep(rdeps, cp, '|'); /* run deps */ if (index(cp, '|')) - cp += copy_to_sep(junk, cp, '|'); /* url - not used */ + cp += skip_to_sep(cp, '|'); /* url - not used */ else { strncpy(junk, cp, 1023); *volume = 0; return 0; } if (index(cp, '|')) - cp += copy_to_sep(junk, cp, '|'); /* extract deps - not used */ + cp += skip_to_sep(cp, '|'); /* extract deps - not used */ if (index(cp, '|')) - cp += copy_to_sep(junk, cp, '|'); /* patch deps - not used */ + cp += skip_to_sep(cp, '|'); /* patch deps - not used */ if (index(cp, '|')) - cp += copy_to_sep(junk, cp, '|'); /* fetch deps - not used */ + cp += skip_to_sep(cp, '|'); /* fetch deps - not used */ if (index(cp, '|')) cp += copy_to_sep(volstr, cp, '|'); /* media volume */ else { |