diff options
author | Florian Larysch <fl@n621.de> | 2020-08-03 19:23:23 +0200 |
---|---|---|
committer | Florian Larysch <fl@n621.de> | 2020-08-03 19:26:43 +0200 |
commit | 924aaae0883ef8962e0af1a4a57b288519330c9b (patch) | |
tree | 7fded574955b234bf61d45e399706add0369b663 | |
parent | 3602bd64b84c20186bb72ce209b8b0023b0c50f9 (diff) | |
download | genimage-924aaae0883ef8962e0af1a4a57b288519330c9b.tar.gz genimage-924aaae0883ef8962e0af1a4a57b288519330c9b.tar.xz |
genimage: initialize return value
The "ret" variable in image_setup is not initialized when an image does
not contain any partitions and the image handler does not provide a
setup function. This can cause image_setup to error out erroneously.
These conditions are fulfilled by the cpio test case, but this bug only
becomes visible when the stack content aligns accordingly.
Initialize ret to 0, as image_setup can be considered successful in this
case.
Signed-off-by: Florian Larysch <fl@n621.de>
-rw-r--r-- | genimage.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -147,7 +147,7 @@ struct image *image_get(const char *filename) */ static int image_setup(struct image *image) { - int ret; + int ret = 0; struct partition *part; if (image->done < 0) |