Skip to content

Commit 8c4f778

Browse files
committed
[json_ptr] fix memory error
Related to #1439
1 parent 6c2cce1 commit 8c4f778

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/yajlpp/json_ptr.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ json_ptr::encode(char* dst, size_t dst_len, const char* src, size_t src_len)
202202
case '/':
203203
case '~':
204204
case '#':
205-
if (retval < dst_len) {
205+
if (retval + 1 < dst_len) {
206206
dst[retval] = '~';
207207
retval += 1;
208208
if (src[lpc] == '~') {

0 commit comments

Comments
 (0)