Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1197725

Bug#1071219: apt: debListParser fails to parse arch lists with extraneous whitespace: terminate called after throwing an instance of 'std::length_error'

From David Kalnischkies <david@kalnischkies.de>
Newsgroups linux.debian.bugs.dist
Subject Bug#1071219: apt: debListParser fails to parse arch lists with extraneous whitespace: terminate called after throwing an instance of 'std::length_error'
Date 2024-05-17 15:00 +0200
Message-ID <IF5lM-dXAL-1@gated-at.bofh.it> (permalink)
References <IEIfv-dJwr-1@gated-at.bofh.it> <IEIfv-dJwr-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

(This mail is only related to the quoted sidenote question)

On Thu, May 16, 2024 at 02:11:41PM +0200, Andreas Beckmann wrote:
> not sure if it is allowed to inject spaces between '!' and arch as in
> ..."  ppc64  !  mips64el ! s390x "...

No, debian-policy §7.1 says "Exclamation marks may be prepended to each
of the names." and said right before that "[…] names […] separated by
whitespace".

dpkg agrees on this:
| LANG=C dpkg-checkbuilddeps -d 'foobar [! amd64]' /dev/null
| dpkg-checkbuilddeps: error: '!' is not a legal architecture in list '! amd64'


It does have interesting behaviour on another whitespace-related case
which is forbidden by policy via "The brackets enclose a non-empty list":
| LANG=C dpkg-checkbuilddeps -d 'foobar []' /dev/null
| dpkg-checkbuilddeps: warning: can't parse dependency foobar []
| dpkg-checkbuilddeps: error: cannot parse Build-Depends/Build-Depends-Arch/Build-Depends-Indep field

vs

| LANG=C dpkg-checkbuilddeps -d 'foobar [ ]' /dev/null && echo 'OK'
| OK

(but undefined behaviour on bad input isn't too bad)


As a sidenote, as you haven't started with a '!' that string is a policy
violation due to "(It is not permitted for some names to be prepended
with exclamation marks while others aren’t.)". dpkg and APT both parse
such strings and do what might be meant by it through.


Best regards

David Kalnischkies

Back to linux.debian.bugs.dist | Previous | Next | Find similar


Thread

Bug#1071219: apt: debListParser fails to parse arch lists with extraneous whitespace: terminate called after throwing an instance of 'std::length_error' David Kalnischkies <david@kalnischkies.de> - 2024-05-17 15:00 +0200

csiph-web