Check if all required bytes were read

Fixes CID 350077

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2019-11-15 11:14:34 +01:00 committed by Dirk Hohndel
parent 08cb521cf2
commit c2d5de207d

View file

@ -603,7 +603,7 @@ static bool uemis_get_answer(const char *path, char *request, int n_param_in,
free(ans_path);
return false;
}
if (read(ans_file, tmp, 100) < 0) {
if (read(ans_file, tmp, 100) < 3) {
free(ans_path);
close(ans_file);
return false;