You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem that may concern some compilers is that "sEXPRSTART" is defined as 0x80 and buffers "stgbuf", "stgpipe", function "stgmark" and other releated functions which deal with them are defined as "char" which if the compiler defines it to be "signed" means that the maximum is SCHAR_MAX which is 2^7-1 or 127 or 0x7F clearly causing overflow, if the compiler defines the "char" as "unsigned" then there won't be any problems because the maximum is UCHAR_MAX which is 2^8-1 or 255 or 0xFF. Note that "sEXPRSTART" directly relates to the "sMAXARGS" defined as 127(0x7F) which is maximum amount of arguments. Probably the best solution is to define everything that concerns those buffers as "unsigned char" and cast it to appropriate "char" where needed(e.g. strlen).
The text was updated successfully, but these errors were encountered:
The problem that may concern some compilers is that "sEXPRSTART" is defined as 0x80 and buffers "stgbuf", "stgpipe", function "stgmark" and other releated functions which deal with them are defined as "char" which if the compiler defines it to be "signed" means that the maximum is SCHAR_MAX which is 2^7-1 or 127 or 0x7F clearly causing overflow, if the compiler defines the "char" as "unsigned" then there won't be any problems because the maximum is UCHAR_MAX which is 2^8-1 or 255 or 0xFF. Note that "sEXPRSTART" directly relates to the "sMAXARGS" defined as 127(0x7F) which is maximum amount of arguments. Probably the best solution is to define everything that concerns those buffers as "unsigned char" and cast it to appropriate "char" where needed(e.g. strlen).
The text was updated successfully, but these errors were encountered: