adafruit/Adafruit_GPS

isEmpty() dereferences pointer before checking if it is NULL.

Opened this issue · 0 comments

if (',' != *pStart && '*' != *pStart && pStart != NULL)

I'm getting a crash in this library. I don't know if this is the root cause, but the logic in isEmpty is backwards.

The NULL check needs to happen before dereferencing the pointer.

Should be...
if (pStart != NULL && ',' != *pStart && '*' != *pStart)