aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2012-03-30 20:50:25 +0100
committerMichael Brown <mcb30@ipxe.org>2012-03-30 20:50:25 +0100
commit275fdae9bb3aafa6db1a089821654323f9990042 (patch)
treeb0b1327624ccf9b9cb2cfbb39e1889ea1c23b8e5
parentf5c644cbe156573d23824a5c7046d1dec93eaf58 (diff)
downloadipxe-275fdae9bb3aafa6db1a089821654323f9990042.tar.gz
[image] Fix use-after-free in debug messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/core/image.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/image.c b/src/core/image.c
index 3cb2d62d..10580925 100644
--- a/src/core/image.c
+++ b/src/core/image.c
@@ -67,13 +67,13 @@ static int require_trusted_images_permanent = 0;
static void free_image ( struct refcnt *refcnt ) {
struct image *image = container_of ( refcnt, struct image, refcnt );
+ DBGC ( image, "IMAGE %s freed\n", image->name );
free ( image->name );
free ( image->cmdline );
uri_put ( image->uri );
ufree ( image->data );
image_put ( image->replacement );
free ( image );
- DBGC ( image, "IMAGE %s freed\n", image->name );
}
/**
@@ -327,8 +327,8 @@ int image_exec ( struct image *image ) {
/* Tail-recurse into replacement image, if one exists */
if ( replacement ) {
- DBGC ( image, "IMAGE %s replacing self with IMAGE %s\n",
- image->name, replacement->name );
+ DBGC ( image, "IMAGE <freed> replacing self with IMAGE %s\n",
+ replacement->name );
if ( ( rc = image_exec ( replacement ) ) != 0 )
return rc;
}