<feed xmlns='http://www.w3.org/2005/Atom'>
<title>apt/apt-pkg/tagfile.cc, branch 2.7.3</title>
<subtitle>Debians commandline package manager</subtitle>
<id>https://git.kalnischkies.de/apt/atom?h=2.7.3</id>
<link rel='self' href='https://git.kalnischkies.de/apt/atom?h=2.7.3'/>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/'/>
<updated>2022-04-01T12:16:19Z</updated>
<entry>
<title>Use pkgTagSection::Key in more places in src:apt</title>
<updated>2022-04-01T12:16:19Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2022-04-01T11:45:09Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=472376be6818b5ea43250abcbecfcab53b4a729a'/>
<id>urn:sha1:472376be6818b5ea43250abcbecfcab53b4a729a</id>
<content type='text'>
The speed critical paths were converted earlier, but the remaining
could benefit a tiny bit from this as well especially as we have the
facility now available and can therefore brush up the code in various
places in the process as well.

Also takes the time to add the hidden Exists method advertised in
the headers, but previously not implemented.
</content>
</entry>
<entry>
<title>Avoid .c_str() on strings feed into pkgTagSection::FindS</title>
<updated>2022-04-01T12:16:19Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2022-03-28T16:05:44Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=0b156cd1711a5e27643b941f5a321a62e5a9b628'/>
<id>urn:sha1:0b156cd1711a5e27643b941f5a321a62e5a9b628</id>
<content type='text'>
FindS has a APT::StringView based API nowadays, so we can avoid these
explicit calls also allowing us to avoid the std::string in input or
output entirely or at least move it a few branches down.
</content>
</entry>
<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>
</feed>
