Skip to content

Crash at ParseLNGFile() if the LNG file is not BOM encoded #2

@PROfile-

Description

@PROfile-

I'm using WinCDEmu and sometimes when I mount an image (via shell integration) the vmnt crashes.
The problem is the wcsstr() wants to access to an unallocated memory address. Here is the source:
https://github.com/sysprogs/BazisLib/blob/master/bzshlp/Win32/LNGManager.cpp#L108

Call stack:
https://github.com/sysprogs/BazisLib/blob/master/bzshlp/textfile.h#L25
https://github.com/sysprogs/BazisLib/blob/master/bzshlp/textfile.h#L81
https://github.com/sysprogs/BazisLib/blob/master/bzshlp/Win32/LNGManager.cpp#L108

The error occurs only when any non-engilsh lng file exists in the WinCDEmu/langfiles folder.

I'm quite sure the problem is the BOM encoding of the lng files.
The english is encoded with the BOM header, but the others are not.

The english is "Generated by BazisLib STRGEN.EXE, http://bazislib.sysprogs.org/"
The nonenglish is "Generated by online LNG editor, http://wincdemu.sysprogs.org/translations/lngedit.php"

If I change the encodings of the non-english lng files to include the BOM header it works perfectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions