[embed] Add missing register_image() to image/embedded.c
authorMichael Brown <mcb30@etherboot.org>
Tue, 3 Jun 2008 23:02:23 +0000 (00:02 +0100)
committerMichael Brown <mcb30@etherboot.org>
Tue, 3 Jun 2008 23:02:23 +0000 (00:02 +0100)
When the embedded image is a script, the unregister_image() performed by
image/script.c corrupts memory, since image/embedded.c omitted the call
to register_image().

This is the first bug fixed using Stefan Hajnoczi's gdb stub for gPXE.

src/image/embedded.c

index e2782a4..9783313 100644 (file)
@@ -39,6 +39,7 @@ struct image *embedded_image(void)
                return image = NULL;
        }
        copy_to_user(image->data, 0, _embedded_image_start, eisize);
+       register_image(image);
 
        /* Reclaim embedded image memory */
        reclaimed = 1;