Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Fix cve-check-update looping processing META files #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akarollil
Copy link

@akarollil akarollil commented Sep 18, 2018

META file should have key:value lines but if the NIST NVD website is
down, instead of the META file, the page describing the site being down
is downloaded instead, which results in cve-check-update getting stuck
in a loop trying to process the invalid META file. This can also be
reproduced easily by tweaking a valid META file to have a colon (:) as
the first character in the file. fscanf fails match, and so doesn't
update the file pointer, and the loop doesn't break if there is no
match unless its EOF.

Fix by using fgets to get lines, and sscanf to parse them to keep file
pointer handling simple.

@akarollil akarollil force-pushed the fix-update-loop branch 2 times, most recently from e45e646 to 9646a3b Compare September 18, 2018 18:50
META file should have key:value lines but if the NIST NVD website is
down, instead of the META file, the page describing the site being down
is downloaded instead, which results in cve-check-update getting stuck
in a loop trying to process the invalid META file. This can also be
reproduced easily by tweaking a valid META file to have a colon (:) as
the first character in the file. fscanf fails match, and so doesn't
update the file pointer, and the loop doesn't break if there is no
match unless its EOF.

Fix by using fgets to get lines, and sscanf to parse them to keep file
pointer handling simple.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant