1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

The recently comitted BPM port fails to handle the new INDEX file

format, which has had several fields added to it.  In addition, it
reacts badly when parse errors occur on the INDEX file, resulting in
double free()s.  The patch works around both of these problems
until the next formal release.

PR:		ports/71213
Submitted by:	maintainer
This commit is contained in:
Adam Weinberger 2004-09-01 01:40:34 +00:00
parent 54d91f4e84
commit b53f2958fe
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=117776
4 changed files with 48 additions and 0 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= bpm
PORTVERSION= 0.4.1b
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://www.meowfishies.com/code/bpm/
EXTRACT_SUFX= .tgz

View File

@ -12,3 +12,26 @@
#define INDEX_MAXLN 4096
#define DB_DIR "/var/db/pkg"
#define ITER_BYTES (128 * 1024)
@@ -183,10 +187,12 @@
if (*sp == '|')
++i;
- if (i != (PFIELD_NFIELD - 1))
+ if (i < (PFIELD_NFIELD - 1))
{
#ifdef DEBUG
- warnx("invalid number of fields");
+ warnx("invalid number of fields (%d should be %d)",
+ i + 1,
+ PFIELD_NFIELD);
#endif /* DEBUG */
return FALSE;
}
@@ -320,7 +326,6 @@
if (_refresh_index_parse(ln, portdp, rdp) != TRUE)
{
- _refresh_portfree(portdp);
#ifdef DEBUG
warnx("%s:%u: invalid format", INDEX_FN, rdp->rd_linec);
#endif /* DEBUG */

View File

@ -7,6 +7,7 @@
PORTNAME= bpm
PORTVERSION= 0.4.1b
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://www.meowfishies.com/code/bpm/
EXTRACT_SUFX= .tgz

View File

@ -12,3 +12,26 @@
#define INDEX_MAXLN 4096
#define DB_DIR "/var/db/pkg"
#define ITER_BYTES (128 * 1024)
@@ -183,10 +187,12 @@
if (*sp == '|')
++i;
- if (i != (PFIELD_NFIELD - 1))
+ if (i < (PFIELD_NFIELD - 1))
{
#ifdef DEBUG
- warnx("invalid number of fields");
+ warnx("invalid number of fields (%d should be %d)",
+ i + 1,
+ PFIELD_NFIELD);
#endif /* DEBUG */
return FALSE;
}
@@ -320,7 +326,6 @@
if (_refresh_index_parse(ln, portdp, rdp) != TRUE)
{
- _refresh_portfree(portdp);
#ifdef DEBUG
warnx("%s:%u: invalid format", INDEX_FN, rdp->rd_linec);
#endif /* DEBUG */