X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=tools%2Fmkenvimage.c;h=75967d0c2d59667da31ada29bc3d7abb3e3b5acc;hb=9b2c8c30668c2d3ea8637cdce436be67241981b3;hp=716cb73a5c63b70d18943e0e9629eb22d9c5965b;hpb=3559028cb2840cc283652f4b7e4e1b457e6ec6a5;p=oweals%2Fu-boot.git diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c index 716cb73a5c..75967d0c2d 100644 --- a/tools/mkenvimage.c +++ b/tools/mkenvimage.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2011 Free Electrons * David Wagner @@ -5,8 +6,6 @@ * Inspired from envcrc.c: * (C) Copyright 2001 * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -162,7 +161,7 @@ int main(int argc, char **argv) txt_fd = STDIN_FILENO; do { - filebuf = realloc(filebuf, readlen); + filebuf = realloc(filebuf, filesize + readlen); if (!filebuf) { fprintf(stderr, "Can't realloc memory for the input file buffer\n"); return EXIT_FAILURE;