[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#154898: doesn't handle whitespace in versioned relationships correctly



Package: dpkg
Version: 1.10.4
Severity: normal
Tags: patch

dpkg does not handle whitespace in versioned relationships correctly if
it happends to be after the version and before the closing parenthesis
as in 
  Conflicts: uucp (<< 1.06.1+1.07beta1-patch2-1 )
                                               ^

diff -Nr -U 10 dpkg-1.10.4/lib/fields.c dpkg-1.10.4.1/lib/fields.c
--- dpkg-1.10.4/lib/fields.c	2002-05-06 18:18:15.000000000 +0200
+++ dpkg-1.10.4.1/lib/fields.c	2002-07-31 02:56:33.000000000 +0200
@@ -368,31 +368,31 @@
                    fip->name,depname);
         }
 /* skip spaces between the relation and the version */
         while (isspace(*p)) p++;
 
 	versionstart= p;
         while (*p && *p != ')' && *p != '(') {
           if (isspace(*p)) break;
           p++;
         }
+	versionlength= p - versionstart;
         while (isspace(*p)) p++;
         if (*p == '(') parseerr(NULL,filename,lno, warnto,warncount,pigp,0,
                                 _("`%s' field, reference to `%.255s': "
                                 "version contains `('"),fip->name,depname);
 	else if (*p != ')') parseerr(NULL,filename,lno, warnto,warncount,pigp,0,
                                 _("`%s' field, reference to `%.255s': "
                                 "version contains ` '"),fip->name,depname);
         else if (*p == 0) parseerr(NULL,filename,lno, warnto,warncount,pigp,0,
                                    _("`%s' field, reference to `%.255s': "
                                    "version unterminated"),fip->name,depname);
-	versionlength= p - versionstart;
 	if (versionlength >=  versionused) {
 	  versionused= versionlength;
 	  version= realloc(version,versionlength+1);
 	}
 	strncpy(version,  versionstart, versionlength);
 	*(version + versionlength)= 0;
         emsg= parseversion(&dop->version,version);
         if (emsg) parseerr(NULL,filename,lno, warnto,warncount,pigp,0,
                            _("`%s' field, reference to `%.255s': "
                            "error in version: %.255s"),fip->name,depname,emsg);

					yours,
					peter

-- 
 PGP signed and encrypted  |  .''`.  ** Debian GNU/Linux **
    messages preferred.    | : :' :      The  universal
                           | `. `'      Operating System
 http://www.palfrader.org/ |   `-    http://www.debian.org/

Attachment: pgpc7Z2XdoNAd.pgp
Description: PGP signature


Reply to: