kolide / launcher

Osquery launcher, autoupdater, and packager
https://kolide.com/launcher
Other
501 stars 99 forks source link

Continue in kolide_jwt when rawData is empty #1751

Closed Micah-Kolide closed 2 weeks ago

Micah-Kolide commented 2 weeks ago

Attempting to pass an empty or null token to the jwt parser will cause a fatal error (ErrTokenMalformed) and panic (panic: runtime error: invalid memory address or nil pointer dereference). I'm simply checking that the rawData is not of length 0, otherwise throw the same error (error reading JWT data file) before trying to hand it off to the jwt parser.

Something I should've caught previously, but I did not have a test for it. I do now.