sdt: start checking version field when parsing probe definitions

This is an extra safety measure.

MFC after:	21 days
This commit is contained in:
Andriy Gapon 2015-09-29 11:58:21 +00:00
parent c9d71814d5
commit 09999d92b1

View File

@ -141,6 +141,12 @@ sdt_create_probe(struct sdt_probe *probe)
char *to;
size_t len;
if (probe->version != (int)sizeof(*probe)) {
printf("ignoring probe %p, version %u expected %u\n",
probe, probe->version, (int)sizeof(*probe));
return;
}
TAILQ_FOREACH(prov, &sdt_prov_list, prov_entry)
if (strcmp(prov->name, probe->prov->name) == 0)
break;