pmc: goto out when get unknown management tlv
If handle unknown management tlv. The management message id and format are also unknown, thus we may crash due to access unknown area. Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>master
parent
a216b11ce5
commit
95b5a13cb2
1
pmc.c
1
pmc.c
|
@ -217,6 +217,7 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
|
||||||
goto out;
|
goto out;
|
||||||
} else {
|
} else {
|
||||||
fprintf(fp, "unknown-tlv ");
|
fprintf(fp, "unknown-tlv ");
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
mgt = (struct management_tlv *) msg->management.suffix;
|
mgt = (struct management_tlv *) msg->management.suffix;
|
||||||
if (mgt->length == 2 && mgt->id != TLV_NULL_MANAGEMENT) {
|
if (mgt->length == 2 && mgt->id != TLV_NULL_MANAGEMENT) {
|
||||||
|
|
Loading…
Reference in New Issue