[PATCH 6.1 632/798] lib/buildid: harden build ID parsing logic