[egg] Fix assertion when releasing secure memory block.
authorStef Walter <stef@memberwebs.com>
Wed, 30 Sep 2009 01:48:10 +0000 (01:48 +0000)
committerStef Walter <stef@memberwebs.com>
Wed, 30 Sep 2009 01:48:10 +0000 (01:48 +0000)
If a secure memory block was allocated that was not multiple of
page size, then on releasing that block, an assertion was
raised. The source of the problem was a lack of tracking the
actually allocated block size.

egg/egg-secure-memory.c

index 36c4e6a..1153bb0 100644 (file)
@@ -873,8 +873,8 @@ sec_block_create (size_t size)
        if (size < DEFAULT_BLOCK_SIZE)
                size = DEFAULT_BLOCK_SIZE;
 
-       block->n_words = size / sizeof (word_t);
        block->words = sec_acquire_pages (&size);
+       block->n_words = size / sizeof (word_t);
        if (!block->words) {
                pool_free (block);
                pool_free (cell);