Skip to content

Commit

Permalink
lejp: always allow an extra byte at the end of the string buffer for NUL
Browse files Browse the repository at this point in the history
  • Loading branch information
lws-team committed Sep 11, 2018
1 parent e618ce1 commit 60362c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/libwebsockets/lws-lejp.h
Expand Up @@ -184,7 +184,7 @@ typedef signed char (*lejp_callback)(struct lejp_ctx *ctx, char reason);
#endif
#ifndef LEJP_STRING_CHUNK
/* must be >= 30 to assemble floats */
#define LEJP_STRING_CHUNK 255
#define LEJP_STRING_CHUNK 254
#endif

enum num_flags {
Expand Down Expand Up @@ -218,7 +218,7 @@ struct lejp_ctx {
uint16_t i[LEJP_MAX_INDEX_DEPTH]; /* index array */
uint16_t wild[LEJP_MAX_INDEX_DEPTH]; /* index array */
char path[LEJP_MAX_PATH];
char buf[LEJP_STRING_CHUNK];
char buf[LEJP_STRING_CHUNK + 1];

/* int */

Expand Down

0 comments on commit 60362c7

Please sign in to comment.