From 2e39d0fdeff5f9db91b3490d6750c8033aca9057 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 30 Jan 2025 15:22:14 +0000 Subject: Do not overflow ver/desc<->file relation counters The counters aren't used for anything really except for the 'stats' command that is off in its display and calculation due to 16bit not being enough for counting all the relations we have. Semi-broken more than a decade ago as I accidentally aligned it with the other file relation counters which count far less frequent ones through, so 'unsigned long' should have been changed to the id type rather than the smaller fileid type. Of course, this commit only prepares the fix as this would be an ABI break, so with the current ABI we are still overflowing. Regression-of: 4ad8619bb1f0bf777d17c568bb7a6cf7f30aac34 --- apt-pkg/pkgcache.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 476a01514..f6d0ea097 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -341,8 +341,13 @@ struct pkgCache::Header map_id_t DependsDataCount; map_fileid_t ReleaseFileCount; map_fileid_t PackageFileCount; +#if APT_PKG_ABI <= 600 map_fileid_t VerFileCount; map_fileid_t DescFileCount; +#else + map_id_t VerFileCount; + map_id_t DescFileCount; +#endif map_id_t ProvidesCount; /** \brief index of the first PackageFile structure -- cgit v1.2.3-70-g09d2