improved/well-completely rewritten rtsig support by Mathew Mills; fix some

cases where regress would not pass on Linux


svn:r204
This commit is contained in:
Niels Provos 2006-02-26 20:18:35 +00:00
parent f6550f407c
commit 60192b4625
2 changed files with 864 additions and 309 deletions

1160
rtsig.c

File diff suppressed because it is too large Load Diff

View File

@ -754,16 +754,21 @@ evtag_fuzz()
struct timeval tv;
int i, j;
int not_failed = 0;
for (j = 0; j < 100; j++) {
for (i = 0; i < sizeof(buffer); i++)
buffer[i] = rand();
evbuffer_drain(tmp, -1);
evbuffer_add(tmp, buffer, sizeof(buffer));
if (evtag_unmarshal_timeval(tmp, 0, &tv) != -1) {
fprintf(stderr, "evtag_unmarshal should have failed");
exit(1);
}
if (evtag_unmarshal_timeval(tmp, 0, &tv) != -1)
not_failed++;
}
/* The majority of decodes should fail */
if (not_failed >= 10) {
fprintf(stderr, "evtag_unmarshal should have failed");
exit(1);
}
/* Now insert some corruption into the tag length field */