diff --git a/mgmt/main.c b/mgmt/main.c
index 37e0bdd..6090eed 100644
--- a/mgmt/main.c
+++ b/mgmt/main.c
exit(EXIT_FAILURE);
}
+ if (len < sizeof(*rp)) {
+ fprintf(stderr, "Too small info reply (%u bytes)\n", len);
+ exit(EXIT_FAILURE);
+ }
+
ba2str(&rp->bdaddr, addr);
printf("hci%u:\ttype %u addr %s\n", id, rp->type, addr);
printf("\tclass 0x%02x%02x%02x\n",
exit(EXIT_FAILURE);
}
+ if (len < sizeof(*rp)) {
+ fprintf(stderr, "Too small set_powered response (%u bytes)\n",
+ len);
+ exit(EXIT_FAILURE);
+ }
+
printf("hci%u powered %s\n", id, rp->val ? "on" : "off");
exit(EXIT_SUCCESS);