From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040808 Firefox/0.9.3 Description of problem: Valgrind (and manual code inspection) indicates that file accesses an element of magic[] one beyond that array's size on line 137 of softmagic.c. Version-Release number of selected component (if applicable): 4.07-4 How reproducible: Always Steps to Reproduce: 1. echo "foobar" > foo 2. valgrind --tool=memcheck file foo 3. observe invalid memory access warning Actual Results: ==15592== Invalid read of size 2 ==15592== at 0x1B9321A5: (within /usr/lib/libmagic.so.1.0) ==15592== by 0x1B932072: file_softmagic (in /usr/lib/libmagic.so.1.0) ==15592== by 0x1B937981: file_buffer (in /usr/lib/libmagic.so.1.0) ==15592== by 0x1B93032C: magic_file (in /usr/lib/libmagic.so.1.0) ==15592== Address 0x1BDC9F00 is not stack'd, malloc'd or (recently) free'd foo: ASCII text Expected Results: foo: ASCII text Additional info:
Created attachment 104002 [details] Prevents beyond-end-of-array access from occurring
Bug is already fixed in file-4.10-1