]> code.ossystems Code Review - openembedded-core.git/commit
cve-update-db-native: improve metadata parsing
authorRoss Burton <ross.burton@intel.com>
Fri, 19 Jul 2019 20:33:18 +0000 (21:33 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 20 Jul 2019 11:04:24 +0000 (12:04 +0100)
commitbb4e53af33d6ca1e9346464adbdc1b39c47530f3
treeaa8b8509c48d42c4fc7b99c20f4c734f7d6a314b
parentb309840b6aa3423b909a43499356e929c8761318
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.

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