Increase size of the static buffer used to hold runtime dependency list

read from CD from 2k to 16k, because in the modern world of meta-packages
(Gnome et al) the length of this list could easily owerflow limit causing
strange things to happen, ranging from installation failure due to list
truncation to complete stack trashing (there is very vague bounds checking).
For example, x11/gnome2-fifth-toe runtime dependencies list is 2,418 bytes
long.

Due to obvious reasons, this is an immediate MFC candidate.

Sponsored by:	Porta Software Ltd
MFC after:	1 day
This commit is contained in:
Maxim Sobolev 2003-02-27 20:43:52 +00:00
parent 295435632d
commit 892c3d7abc

View file

@ -286,7 +286,7 @@ readline(FILE *fp, char *buf, int max)
int
index_parse(FILE *fp, char *name, char *pathto, char *prefix, char *comment, char *descr, char *maint, char *cats, char *rdeps, int *volume)
{
char line[10240];
char line[10240 + 2048 * 7];
char junk[2048];
char volstr[2048];
char *cp;
@ -324,7 +324,7 @@ index_parse(FILE *fp, char *name, char *pathto, char *prefix, char *comment, cha
int
index_read(FILE *fp, PkgNodePtr papa)
{
char name[127], pathto[255], prefix[255], comment[255], descr[127], maint[127], cats[511], deps[2048];
char name[127], pathto[255], prefix[255], comment[255], descr[127], maint[127], cats[511], deps[2048 * 8];
int volume;
PkgNodePtr i;
@ -699,7 +699,7 @@ index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended)
}
if (id && id->deps && strlen(id->deps)) {
char t[2048], *cp, *cp2;
char t[2048 * 8], *cp, *cp2;
SAFE_STRCPY(t, id->deps);
cp = t;
@ -740,7 +740,7 @@ index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended)
static void
index_recorddeps(Boolean add, PkgNodePtr root, IndexEntryPtr ie)
{
char depends[1024], *space, *todo;
char depends[1024 * 16], *space, *todo;
PkgNodePtr found;
IndexEntryPtr found_ie;