]> code.ossystems Code Review - openembedded-core.git/commit
cve-update-db-native: improve metadata parsing
authorRoss Burton <ross.burton@intel.com>
Wed, 6 Nov 2019 15:37:40 +0000 (17:37 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 6 Nov 2019 20:44:15 +0000 (20:44 +0000)
commitc718e073e8e9cd5df9e19dd02fcac2139758b5b7
tree42caf649d42df5eb4e6738ce149ccef22bf4afda
parentd248ec9764d0439eb30fdb3605e9d05ee4219348
cve-update-db-native: improve metadata parsing

The metadata parser is fragile: first it coerces a bytes() to a str() (so the
string is b'LastModifiedDate:2019...'), assumes the first line is the date, and
then uses a regex to parse (which then includes the trailing quote as part of
the date).

Clean this up by parsing the bytes as UTF-8 (ASCII is probably fine, but this is
safer), iterate through the lines and split on colons to find the right
key/value pair.

(From OE-Core rev: bb4e53af33d6ca1e9346464adbdc1b39c47530f3)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/meta/cve-update-db-native.bb