edbee-lib icon indicating copy to clipboard operation
edbee-lib copied to clipboard

Dodgy looking casts

Open SlySven opened this issue 6 years ago • 1 comments

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! :fearful:

SlySven avatar Apr 07 '19 23:04 SlySven

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

gamecreature avatar Apr 08 '19 07:04 gamecreature