[Libosinfo] [libosinfo PATCH 2/4] media: Don't assume identifiers are null terminated

Christophe Fergeau cfergeau at redhat.com
Thu Feb 14 11:01:17 UTC 2019


On Thu, Feb 14, 2019 at 11:05:39AM +0100, Fabiano Fidêncio wrote:
> On Thu, Feb 14, 2019 at 10:57 AM Christophe Fergeau <cfergeau at redhat.com>
> wrote:
> 
> > Hey,
> >
> > On Wed, Feb 13, 2019 at 08:19:25PM +0100, Fabiano Fidêncio wrote:
> > > Identifiers as volume-id, application, publisher, and system are not
> > > null terminated and cannot be assumed as so.
> > >
> > > By assuming those are null terminated strings, libosinfo ends up not
> > > counting the last character of a MAX_* string and, consequently, not
> > > properly identifying medias that have their identifiers with the MAX_*
> > > size.
> > >
> > > One example is the ubuntu-18.04.1.0-live-server-amd64.iso media, which
> > > has as volume-id 'Ubuntu-Server 18.04.1+ LTS amd64'. As the volume-id
> > > has exactly 32 characters it's never been matched as when reading the
> > > media's volume-id it'd be read as 'Ubuntu-Server 18.04.1+ LTS amd6'.
> >
> > I don't think we have any test case for that code, do we?
> >
> 
> We don't have any specific test case for this code. But the whole
> test-isodetect relies on this (and that's the way I found out the issue
> when adding the new test data).
> 
> Do you want a specific test for this or are you fine with the patch 4
> covering this case?

Ideally we would have a test case for this code, but this is just
something to add to the bottom of the project todo ;)

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20190214/75e3484d/attachment.sig>


More information about the Libosinfo mailing list