Hangbin Liu
2017-05-23 06:49:55 UTC
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 <***@gmail.com>
---
pmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/pmc.c b/pmc.c
index 261f2a2..b968898 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) {
also unknown, thus we may crash due to access unknown area.
Signed-off-by: Hangbin Liu <***@gmail.com>
---
pmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/pmc.c b/pmc.c
index 261f2a2..b968898 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) {
--
2.5.5
2.5.5