<feed xmlns='http://www.w3.org/2005/Atom'>
<title>apt/apt-pkg/tagfile.cc, branch 2.3.0</title>
<subtitle>Debians commandline package manager</subtitle>
<id>https://git.kalnischkies.de/apt/atom?h=2.3.0</id>
<link rel='self' href='https://git.kalnischkies.de/apt/atom?h=2.3.0'/>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/'/>
<updated>2020-02-26T17:12:18Z</updated>
<entry>
<title>Parse records including empty tag names correctly</title>
<updated>2020-02-26T17:12:18Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2020-02-20T11:49:15Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=110078022a6c6103be8f557aef1e268c4b680d88'/>
<id>urn:sha1:110078022a6c6103be8f557aef1e268c4b680d88</id>
<content type='text'>
No sensible file should include these, but even insensible files do not
gain unfair advantages with it as this parser does not deal with
security critical files before they haven't passed other checks like
signatures or hashsums.

The problem is that the parser accepts and parses empty tag names
correctly, but does not store the data parsed which will effect later
passes over the data resulting e.g. in the following tag containing
the name and value of the previous (empty) tag, its own tagname and its
own value or a crash due to an attempt to access invalid memory
depending on who passes over the data and what is done with it.

This commit fixes both, the incidient of the crash reported by
Anatoly Trosinenko who reproduced it via apt-sortpkgs:
| $ cat /tmp/Packages-null
| 0:
| PACKAGE:0
|
| :
| PACKAGE:
|
| PACKAGE::
| $ apt-sortpkgs /tmp/Packages-null
and the deeper parsing issue shown by the included testcase.

Reported-By: Anatoly Trosinenko &lt;anatoly.trosinenko@gmail.com&gt;
References: 8710a36a01c0cb1648926792c2ad05185535558e
</content>
</entry>
<entry>
<title>tagfile: Check out-of-bounds access to Tags vector</title>
<updated>2020-02-20T12:35:51Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2020-02-20T12:34:37Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=5bdb1892514c641fb0ebcc3103e6f503cdd4b04b'/>
<id>urn:sha1:5bdb1892514c641fb0ebcc3103e6f503cdd4b04b</id>
<content type='text'>
Check that the index we're going to use is within the size
of the array.
</content>
</entry>
<entry>
<title>tagfile: Check if memchr() returned null before using</title>
<updated>2020-02-20T12:35:27Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2020-02-20T12:25:10Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=942be407ee8b6ca1089ed9c2f135ca4ed89c44fc'/>
<id>urn:sha1:942be407ee8b6ca1089ed9c2f135ca4ed89c44fc</id>
<content type='text'>
This fixes a segmentation fault trying to read from nullptr+1,
aka address 1.
</content>
</entry>
<entry>
<title>Follow gcc-9 -Wnoexcept suggestion for FileChunk constructor</title>
<updated>2019-04-16T10:59:54Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2019-04-14T23:56:20Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=febbe5e33b2105c8f40006a4b92ab5aa169aa03c'/>
<id>urn:sha1:febbe5e33b2105c8f40006a4b92ab5aa169aa03c</id>
<content type='text'>
warning: but ‘pkgTagFilePrivate::FileChunk::FileChunk(bool, size_t)’
does not throw; perhaps it should be declared ‘noexcept’ [-Wnoexcept]

Reported-By: gcc-9
Gbp-Dch: Ignore
</content>
</entry>
<entry>
<title>tagfile: Remove deprecated pkgUserTagSection and TFRewrite</title>
<updated>2019-02-26T15:31:20Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2019-02-26T11:14:59Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=975316780b2ba3d4e60592fac9d4eb99ffc4c924'/>
<id>urn:sha1:975316780b2ba3d4e60592fac9d4eb99ffc4c924</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Step over empty sections in TagFiles with comments</title>
<updated>2019-02-01T13:51:56Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2019-02-01T13:51:56Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=5caa8cac3bc0ffa8b5360f3e5d5c84e710eb394b'/>
<id>urn:sha1:5caa8cac3bc0ffa8b5360f3e5d5c84e710eb394b</id>
<content type='text'>
Implementing a parser with recursion isn't the best idea, but in
practice we should get away with it for the time being to avoid
needless codechurn.

Closes: #920317 #921037
</content>
</entry>
<entry>
<title>Remove obsolete RCS keywords</title>
<updated>2018-05-07T11:41:31Z</updated>
<author>
<name>Guillem Jover</name>
<email>guillem@debian.org</email>
</author>
<published>2018-05-06T20:32:41Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=164f1b78d1849a0f33df7352875f86e28f5de06a'/>
<id>urn:sha1:164f1b78d1849a0f33df7352875f86e28f5de06a</id>
<content type='text'>
Prompted-by: Jakub Wilk &lt;jwilk@debian.org&gt;
</content>
</entry>
<entry>
<title>Reformat and sort all includes with clang-format</title>
<updated>2017-07-12T11:57:51Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2017-07-12T11:40:41Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=87274d0f22e1dfd99b2e5200e2fe75c1b804eac3'/>
<id>urn:sha1:87274d0f22e1dfd99b2e5200e2fe75c1b804eac3</id>
<content type='text'>
This makes it easier to see which headers includes what.

The changes were done by running

    git grep -l '#\s*include'  \
        | grep -E '.(cc|h)$' \
        | xargs sed -i -E 's/(^\s*)#(\s*)include/\1#\2 include/'

To modify all include lines by adding a space, and then running
./git-clang-format.sh.
</content>
</entry>
<entry>
<title>fix various typos reported by spellintian</title>
<updated>2017-01-19T14:59:38Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2017-01-19T14:14:19Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=93cff633a830e222693fc0f3d78e6e534d1126ee'/>
<id>urn:sha1:93cff633a830e222693fc0f3d78e6e534d1126ee</id>
<content type='text'>
Most of them in (old) code comments. The two instances of user visible
string changes the po files of the manpages are fixed up as well.

Gbp-Dch: Ignore
Reported-By: spellintian
</content>
</entry>
<entry>
<title>TagSection: Introduce functions for looking up by key ids</title>
<updated>2016-11-22T21:57:46Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2016-09-27T15:32:24Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=abfd07702c1bbc3ed489d015b43db58ab677af0c'/>
<id>urn:sha1:abfd07702c1bbc3ed489d015b43db58ab677af0c</id>
<content type='text'>
Introduce a new enum class and add functions that can do a lookup
with that enum class. This uses triehash.
</content>
</entry>
</feed>
