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

Dodgy looking casts #87

Open
SlySven opened this issue Apr 7, 2019 · 1 comment
Open

Dodgy looking casts #87

SlySven opened this issue Apr 7, 2019 · 1 comment
Labels

Comments

@SlySven
Copy link
Contributor

SlySven commented Apr 7, 2019

In onigmo.h I see the following:

typedef unsigned char  OnigUChar;

however in your regexp.cpp I can see in (int) indexIn( const QChar* charPtr, int offset, int length, bool reverse ) some (old C-style) casting being done on pointers to QChar to convert them into OnigUChar ones so they can have pointer arithmetic being carried out on them - and QChars {at least 16 bits} are not the same size as unsigned chars {8 bits} - which looks very suspect! 😨

@gamecreature
Copy link
Member

gamecreature commented Apr 8, 2019

You're right... This looks very dangerous! 😟

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

No branches or pull requests

2 participants