View Issue Details

IDProjectCategoryView StatusLast Update
0000374fileGeneralpublic2022-08-17 08:48
Reporterpiru Assigned Tochristos  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.42 
Fixed in Version5.43 
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

christos

2022-08-17 08:48

manager   ~0003799

Fixed, thanks!

Issue History

Date Modified Username Field Change
2022-08-06 15:53 piru New Issue
2022-08-17 08:48 christos Assigned To => christos
2022-08-17 08:48 christos Status new => assigned
2022-08-17 08:48 christos Status assigned => resolved
2022-08-17 08:48 christos Resolution open => fixed
2022-08-17 08:48 christos Fixed in Version => 5.43
2022-08-17 08:48 christos Note Added: 0003799