Skip to content
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
merged 1 commit into from
Dec 14, 2017

Conversation

milandinic
Copy link
Contributor

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.

@milandinic milandinic changed the title fox for jwt malloc.c:2394: sysmalloc: Assertion fix for jwt malloc.c:2394: sysmalloc: Assertion Sep 12, 2017
@jpmens jpmens merged commit fe2f51e into jpmens:master Dec 14, 2017
@jpmens
Copy link
Owner

jpmens commented Dec 14, 2017

Merged, thank you.

jpmens added a commit that referenced this pull request Dec 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants