Discussion:
[Linuxptp-devel] [PATCH] pmc: goto out when get unknown management tlv
Hangbin Liu
2017-05-23 06:49:55 UTC
Permalink
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) {
--
2.5.5
Richard Cochran
2017-05-25 11:46:27 UTC
Permalink
Post by Hangbin Liu
If handle unknown management tlv. The management message id and format are
also unknown, thus we may crash due to access unknown area.
Applied.

Thanks,
Richard

Loading...