Skip to content

Conversation

@jukkar
Copy link
Member

@jukkar jukkar commented Nov 8, 2017

No description provided.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only works because %3d has the same number of characters as, say 200 or 404. It might be a good idea to use XXX or something else here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was done on purpose like this so that %3d is three letters wide. This way the same string can be used here and in snprintk(). Note that we only print the code if it is 100-999.

Copy link
Member

@lpereira lpereira Nov 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you also need to send a text after the numerical code? Like 200 OK or 404 Not Found? Most clients will ignore this, but not sending it isn't compliant. See RFC2616, section 6.1.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no string to print atm as only 400 code is having a error string defined.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you think we need the error string too, then we need to fix the API (which is ok in this case as it was merged just one week ago).

It is possible to access past end of url buffer by one byte.

Coverity-CID: 178790
Fixes zephyrproject-rtos#4784

Signed-off-by: Jukka Rissanen <[email protected]>
We might access null pointer in debug print.

Coverity-CID: 178789
Fixes zephyrproject-rtos#4785

Signed-off-by: Jukka Rissanen <[email protected]>
If the packet is too short, the TCP header pointer might be
NULL. In this case we just need to bail out.

Coverity-CID: 178787
Fixes zephyrproject-rtos#4787

Signed-off-by: Jukka Rissanen <[email protected]>
@jukkar
Copy link
Member Author

jukkar commented Nov 10, 2017

I will send the HTTP error patch separately so that it will not block these fixes.

@jukkar
Copy link
Member Author

jukkar commented Nov 13, 2017

@lpereira could you check the PR and approve if ok?

@galak galak added this to the v1.10.0 milestone Nov 14, 2017
@jukkar jukkar merged commit 9663287 into zephyrproject-rtos:master Nov 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants