This repository has been archived by the owner on Mar 12, 2019. It is now read-only.
fix for jwt malloc.c:2394: sysmalloc: Assertion #288
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix for jwt token_header overflow by one.
22 is the length of the ""Authorization: Bearer " char array, but sprintf adds null at the end of token_header and that crashed the plugin every time with
2017-09-12T08:55:50.633878547Z mosquitto: malloc.c:2394: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
I used the this jwt to replicate:
key eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyNCIsImF1dGgiOltdLCJ0b3BpY3MiOlsiMSIsIjIiLCIzIiwiNCIsIjI2IiwiMzIiXSwiZXhwIjoxNTAyMjg1NzM5fQ.RhpfXZHWf4p3msFgHAmdJPjgrxogPSufOcT8_lLeE5bI1Yme7GkFk7WFt4V-pAEwm3llzzloYgnycSh_y5JYVg
It fails for me every time.