Bug 14178 - Empty "md5sum" and/or "size" entries in Packages file cause segfault in opkg
Summary: Empty "md5sum" and/or "size" entries in Packages file cause segfault in opkg
Status: RESOLVED FIXED
Alias: None
Product: opkg
Classification: Yocto Project Subprojects
Component: opkg (show other bugs)
Version: 0.4.4
Hardware: Other Multiple
: Undecided normal
Target Milestone: next-patch
Assignee: Alex Stewart
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2021-01-07 09:40 UTC by kay.hackmack
Modified: 2022-09-09 21:13 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kay.hackmack 2021-01-07 09:40:01 UTC
Due to an error on our side our feed's Packages/Packages.gz was generated like this (xyz is some package-specific data):

Package: xyz
Version: 20.7.0.79-0+d79
Architecture: core2-64
Maintainer: National Instruments <LinuxMaintainers@ni.com>
Source: xyz
Section: Add-Ons
Priority: extra
Depends: xyz
Homepage: https://www.ni.com/linux/
DisplayVersion: 20.7
DisplayName: xyz
UserVisible:  yes
Description: xyz
xyz
MD5Sum: 
Size: 
Filename: xyz.ipk

After opkg on the target accessed/cached that feed it starts segfaulting when running any command.
The key here seems to be that MD5Sum and/or Size: are empty. I'm not sure which entry (MD5Sum or Size) is causing the crash or both at the moment.
Comment 1 Alex Stewart 2021-01-07 13:54:04 UTC
Thanks Kay; accepted.

The fix here should emulate the behavior of dpkg, when given a malformed package stanza - which I'm sure is not a SEGFAULT.

This should also be trivially test-able, so the fix patchset should include a functional test case.
Comment 2 Alex Stewart 2022-09-09 21:13:45 UTC
Resolved by Brenda Streiff's patchset: https://groups.google.com/g/opkg-devel/c/qBwxmV8hFBI