buglwIP - A Lightweight TCP/IP stack - Bugs: bug #52345, MQTT buffer length check seems...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #52345: MQTT buffer length check seems wrong

Submitted by:  David Bourgeois <jaguarondi>
Submitted on:  Sun 05 Nov 2017 11:28:13 PM UTC  
 
Category: appsSeverity: 3 - Normal
Item Group: Crash ErrorStatus: In Progress
Privacy: PublicAssigned to: Dirk Ziegelmeier <dziegel>
Open/Closed: OpenPlanned Release: None
lwIP version: git head

Mon 18 Dec 2017 10:23:37 AM UTC, comment #5:

Alright, reopened.

Simon Goldschmidt <goldsimon>
Project Administrator
Mon 18 Dec 2017 10:13:16 AM UTC, comment #4:

Sorry for the late answer. We still found a case where this fix doesn't work. When the packet sent has no payload and a QoS of 0, then the last byte of the packet is actually the last byte of the payload which isn't null terminated. So the test will always fail in this case and there's no way to add the null termination for the callback.

So here the fix should not only consider the test but also deal with the buffer size.

David Bourgeois <jaguarondi>
Sun 17 Dec 2017 09:26:18 PM UTC, comment #3:

Let's set this fixed until someone complains.

Simon Goldschmidt <goldsimon>
Project Administrator
Sun 26 Nov 2017 08:09:10 PM UTC, comment #2:

Rewrote the fix, I think your fix was wrong. The problem is that the code tries to parse the variable header part of the publish although there is none in the telegram.

Dirk Ziegelmeier <dziegel>
Project MemberIn charge of this item.
Mon 13 Nov 2017 09:30:50 PM UTC, comment #1:

From reading the code, it should IMHO be compared to MQTT_VAR_HEADER_BUFFER_LEN - fixed_hdr_idx.

Can you please test this and report back? Thanks in advance!

Dirk Ziegelmeier <dziegel>
Project MemberIn charge of this item.
Sun 05 Nov 2017 11:28:13 PM UTC, original submission:

The buffer length check fails with an empty payload, it seems the comparison should be done towards MQTT_VAR_HEADER_BUFFER_LEN but I don't know if there are some other length to take into account also.

Here's what I did:

David Bourgeois <jaguarondi>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by dziegel (Posted a comment)
  • -unavailable- added by jaguarondi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 18 Dec 2017 10:23:37 AM UTCgoldsimonStatusFixed=>In Progress
      Open/ClosedClosed=>Open
    Sun 17 Dec 2017 09:26:18 PM UTCgoldsimonStatusReady For Test=>Fixed
      Assigned toNone=>dziegel
      Open/ClosedOpen=>Closed
    Mon 13 Nov 2017 09:30:50 PM UTCdziegelStatusNone=>Ready For Test

    Back to the top


    Powered by Savane 3.1-cleanup1