Closed hmelder closed 10 months ago
Good finds! Can you comment on what kinds of issues this might have caused at runtime?
Can you comment on what kinds of issues this might have caused at runtime?
This one should only be relevant if you are using GCC (or an object file compiled using GCC), as it generates "" for `@encode(BOOL)`, while Clang generates "^c" or "^C". When comparing type encodings, we check for both options.
if ((*t1 == '*') && (*t2 != '*'))
{
- if (*t2 == '^' && (((*(t2+1) == 'C') || (*(t2+2) == 'c'))))
+ if (*t2 == '^' && (((*(t2+1) == 'C') || (*(t2+1) == 'c'))))
Here we do not stop if the second string ends, but as the pointer increment is guarded by an additional check (See line 216), we keep comparing the next char from t1 with \0
until t1 is also \0
.
- while (('\0' != *t1) && ('\0' != *t1))
+ while (('\0' != *t1) && ('\0' != *t2))
Seems like the NUL check and offsets are wrong here.