commit | 061c3cf2ac1c5047cf9adaf771b030a1605b357b | [log] [tgz] |
---|---|---|
author | Andrew Stitcher <astitcher@apache.org> | Tue Jun 22 16:39:48 2021 -0400 |
committer | Andrew Stitcher <astitcher@apache.org> | Wed Sep 01 16:31:20 2021 -0400 |
tree | 64ab39b1801b25dd991198aef3a65ad49e9f2f19 | |
parent | 57836e6773fed271724e6db1757550adfc7b066a [diff] |
PROTON-2426: [C] Fix off by one error in pn_quote_data
diff --git a/c/src/core/util.c b/c/src/core/util.c index 18a9464..bed2a54 100644 --- a/c/src/core/util.c +++ b/c/src/core/util.c
@@ -46,7 +46,7 @@ dst[idx++] = c; } else { if (idx > 0) { - dst[idx - 1] = '\0'; + dst[idx] = '\0'; } return PN_OVERFLOW; } @@ -55,7 +55,7 @@ idx += sprintf(dst + idx, "\\x%.2x", c); } else { if (idx > 0) { - dst[idx - 1] = '\0'; + dst[idx] = '\0'; } return PN_OVERFLOW; }