Comment 11 for bug 614918

Revision history for this message
dth (destotelhorus) wrote :

This is an excerpt of the latest version of icoutils (0.29.1). More specifically out of the wrestool/main.c file. This C-Code will be run for every file you pass as an argument to wrestool:

                /* get file size */
                fi.name = argv[c];
                fi.total_size = file_size(fi.name);
[...]
                /* open file */
                fi.file = fopen(fi.name, "rb");
[...]
                /* read all of file */
                fi.memory = xmalloc(fi.total_size);
                if (fread(fi.memory, fi.total_size, 1, fi.file) != 1)

As promised, it will try to read ALL of the file into memory. Doing this with large self-extracting archives for example is a no-go.