Commit 769204e4 authored by Federico Vaga's avatar Federico Vaga

lib: validate input on close

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 7628823a
......@@ -285,6 +285,11 @@ int fmctdc_close(struct fmctdc_board *userb)
__define_board(b, userb);
int j;
if (!b) {
errno = EINVAL;
return -1;
}
for (j = 0; j < ARRAY_SIZE(b->fdc); j++) {
if (b->fdc[j] >= 0)
close(b->fdc[j]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment