View Issue Details

IDProjectCategoryView StatusLast Update
0000374fileGeneralpublic2022-08-06 15:53
Reporterpiru Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version5.42 
Summary0000374: Endless busyloop in file_mbswidth
Descriptionfile_mbswidth contains an endless bysyloop in the non-widechar version.

The bug is in the while loop:

    while (*s) {
        width += (ms->flags & MAGIC_RAW) != 0
            || isprint(CAST(unsigned char, *s)) ? 1 : 4;
    }

ref: https://github.com/file/file/blob/e1233247bbe4d2d66b891224336a23384a93cce1/src/file.c#L678


Note that variable `s' is not incremented at all. Fix is easy, add s++; to the loop.
Steps To Reproduce1. Build file for system without widechar support
2. file anyfile
Additional InformationThis bug was added by commit https://github.com/file/file/commit/f448f3e5c37de8c285ac14b032b2bdcea82fc08b
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2022-08-06 15:53 piru New Issue