Bug 14178

Summary: Empty "md5sum" and/or "size" entries in Packages file cause segfault in opkg
Product: [Yocto Project Subprojects] opkg Reporter: kay.hackmack
Component: opkgAssignee: Alex Stewart <alex.stewart>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided CC: alex.stewart, kay.hackmack
Version: 0.4.4   
Target Milestone: next-patch   
Hardware: Other   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

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