mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
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:
parent
f6550f407c
commit
60192b4625
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user