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

lib/fields.c:f_dependency() skips spaces in versions



I believe I have discovered a flaw in dpkg's version parsing functions.  If a
space exists in the version, dpkg will skip over it.  Ie, it will convert
'1.2 3.4' to '1.23.4', which I believe is wrong.  It should throw a parseerr.
Please see the following code snippet:

void f_dependency(struct pkginfo *pigp, struct pkginfoperfile *pifp,
....
        varbufreset(&version);
...
        while (*p && *p != ')' && *p != '(') {
          if (!isspace(*p)) varbufaddc(&version,*p);
          p++;
        }
...

It is my opinion(and Wichert's, we talked on irc), that it should give a
parseerr, when a space is inside a version, instead of just silently eating
it.

Ian, is this hypothesis correct?  If so, is this a valid bug, or was this done
on purpose?  If on purpose, why?

----BEGIN GEEK CODE BLOCK----
Version: 3.12
GCS d- s: a-- c+++ UL++++ P+ L++++ !E W+ M o+ K- W--- !O M- !V PS--
PE++ Y+ PGP++ t* 5++ X+ tv b+ D++ G e h*! !r z?
-----END GEEK CODE BLOCK-----
----BEGIN PGP INFO----
Adam Heath <doogie@debian.org>        Finger Print | KeyID
67 01 42 93 CA 37 FB 1E    63 C9 80 1D 08 CF 84 0A | DE656B05 PGP
AD46 C888 F587 F8A3 A6DA  3261 8A2C 7DC2 8BD4 A489 | 8BD4A489 GPG
-----END PGP INFO-----



Reply to: