3370. [bug] Address use after free while shutting down. [RT #30241]

This commit is contained in:
Mark Andrews
2012-08-22 19:19:30 +10:00
parent 26388db87e
commit 8e0a15f42f
4 changed files with 53 additions and 17 deletions

View File

@@ -29,10 +29,11 @@
#include "isctest.h"
typedef struct item {
typedef struct item item_t;
struct item {
int value;
ISC_QLINK(item_t) qlink;
} item_t;
};
typedef ISC_QUEUE(item_t) item_queue_t;
@@ -107,6 +108,9 @@ ATF_TC_BODY(queue_valid, tc) {
ISC_QUEUE_PUSH(queue, &five, qlink);
ATF_CHECK(ISC_QLINK_LINKED(&five, qlink));
/* Test unlink by removing one item from the middle */
ISC_QUEUE_UNLINK(queue, &three, qlink);
ISC_QUEUE_POP(queue, qlink, p);
ATF_REQUIRE(p != NULL);
ATF_CHECK_EQ(p->value, 1);
@@ -115,10 +119,6 @@ ATF_TC_BODY(queue_valid, tc) {
ATF_REQUIRE(p != NULL);
ATF_CHECK_EQ(p->value, 2);
ISC_QUEUE_POP(queue, qlink, p);
ATF_REQUIRE(p != NULL);
ATF_CHECK_EQ(p->value, 3);
ISC_QUEUE_POP(queue, qlink, p);
ATF_REQUIRE(p != NULL);
ATF_CHECK_EQ(p->value, 4);