From 95b5a13cb2787b6a436ad395bb4931d1661e59a7 Mon Sep 17 00:00:00 2001 From: Hangbin Liu Date: Tue, 23 May 2017 14:49:55 +0800 Subject: [PATCH] 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 --- pmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pmc.c b/pmc.c index cefa771..af9cc63 100644 --- a/pmc.c +++ b/pmc.c @@ -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) {