<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14178</bug_id>
          
          <creation_ts>2021-01-07 09:40:01 +0000</creation_ts>
          <short_desc>Empty &quot;md5sum&quot; and/or &quot;size&quot; entries in Packages file cause segfault in opkg</short_desc>
          <delta_ts>2022-09-09 21:13:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>opkg</product>
          <component>opkg</component>
          <version>0.4.4</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>next-patch</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>kay.hackmack</reporter>
          <assigned_to name="Alex Stewart">alex.stewart</assigned_to>
          <cc>alex.stewart</cc>
    
    <cc>kay.hackmack</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88878</commentid>
    <comment_count>0</comment_count>
    <who name="">kay.hackmack</who>
    <bug_when>2021-01-07 09:40:01 +0000</bug_when>
    <thetext>Due to an error on our side our feed&apos;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 &lt;LinuxMaintainers@ni.com&gt;
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&apos;m not sure which entry (MD5Sum or Size) is causing the crash or both at the moment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88879</commentid>
    <comment_count>1</comment_count>
    <who name="Alex Stewart">alex.stewart</who>
    <bug_when>2021-01-07 13:54:04 +0000</bug_when>
    <thetext>Thanks Kay; accepted.

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

This should also be trivially test-able, so the fix patchset should include a functional test case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94022</commentid>
    <comment_count>2</comment_count>
    <who name="Alex Stewart">alex.stewart</who>
    <bug_when>2022-09-09 21:13:45 +0000</bug_when>
    <thetext>Resolved by Brenda Streiff&apos;s patchset: https://groups.google.com/g/opkg-devel/c/qBwxmV8hFBI</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>