Skip to content

Commit

Permalink
pmc: goto out when get unknown management tlv
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
liuhangbin authored and richardcochran committed May 25, 2017
1 parent a216b11 commit 95b5a13
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ static void pmc_show(struct ptp_message *msg, FILE *fp)
goto out;
} else {
fprintf(fp, "unknown-tlv ");
goto out;
}
mgt = (struct management_tlv *) msg->management.suffix;
if (mgt->length == 2 && mgt->id != TLV_NULL_MANAGEMENT) {
Expand Down

0 comments on commit 95b5a13

Please sign in to comment.