Skip to content

Commit

Permalink
WORKAROUND to avoid crash in case of 4-byte UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher J. Brody committed Oct 11, 2018
1 parent b5c05b6 commit 0c48978
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions native/sqlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,13 @@ const char *sqlc_evcore_qc_execute(sqlc_handle_t qc, const char * batch_json, in
pi += 1;
} else if (pc >= 32 && pc < 127) {
rr[rrlen++] = pptext[pi++];
} else if (pc >= 0xf0) {
// TBD WORKAROUND SOLUTION to avoid crash:
rr[rrlen++] = '?';
rr[rrlen++] = '?';
rr[rrlen++] = '?';
rr[rrlen++] = '?';
pi += 4;
} else if (pc >= 0xe0) {
rr[rrlen++] = pptext[pi++];
rr[rrlen++] = pptext[pi++];
Expand Down

0 comments on commit 0c48978

Please sign in to comment.