mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-08 10:32:53 +03:00
fixed bug in size-calculation of coap_new_error_response() (applied patch from Thomas Stammeier)
The calculation of required space for textual error phrase did not take into account the one byte for the payload start marker.
This commit is contained in:
1 parent
b465bcc692
commit
c007638c1a
1 file changed
+2
-2
@@ -775,9 +775,9 @@ coap_new_error_response(coap_pdu_t *request, unsigned char code,
|
||||
#if COAP_ERROR_PHRASE_LENGTH > 0
|
||||
char *phrase = coap_response_phrase(code);
|
||||
|
||||
/* Need some more space for the error phrase */
|
||||
/* Need some more space for the error phrase and payload start marker */
|
||||
if (phrase)
|
||||
size += strlen(phrase);
|
||||
size += strlen(phrase) + 1;
|
||||
#endif
|
||||
|
||||
assert(request);
|
||||
|
||||
Reference in new issue
Block a user