Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PROfile- opened this issue Jun 23, 2015 · 1 comment
Open

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

PROfile- opened this issue Jun 23, 2015 · 1 comment

Comments

@PROfile-
Copy link

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.

@GnstheGrain
Copy link

it's a shame none of the folks @sysprogs is responding to well-researched and reported issues as this ..
Anyway, thanks @PROfile- for reporting. This, i'm sure, is actually much appreciated from many users in here ... Code Audit/Review is a priceless resource in such an hostile era

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants