From ac70ddc363257a5262c7253dc77b7bdc1f99f5aa Mon Sep 17 00:00:00 2001 From: Terry Burton Date: Thu, 18 Jul 2024 02:51:15 +0100 Subject: [PATCH] scandata: Don't strip a terminal GS present in the barcode message (as FNC1) --- src/c-lib/gs1encoders-fuzzer-scandata.c | 4 ---- src/c-lib/scandata.c | 3 --- 2 files changed, 7 deletions(-) diff --git a/src/c-lib/gs1encoders-fuzzer-scandata.c b/src/c-lib/gs1encoders-fuzzer-scandata.c index 8a65d7c..7ba00da 100644 --- a/src/c-lib/gs1encoders-fuzzer-scandata.c +++ b/src/c-lib/gs1encoders-fuzzer-scandata.c @@ -53,10 +53,6 @@ int LLVMFuzzerTestOneInput(const uint8_t* const buf, size_t len) { memcpy(in, buf, len); in[len] = '\0'; - // Strip trailing GS characters from the input - while (strlen(in) > 0 && in[strlen(in)-1] == 0x1D) - in[strlen(in)-1] = '\0'; - memcpy(pristine, in, len); if (!gs1_encoder_setScanData(ctx, in)) diff --git a/src/c-lib/scandata.c b/src/c-lib/scandata.c index 97fb3e4..c82b791 100644 --- a/src/c-lib/scandata.c +++ b/src/c-lib/scandata.c @@ -141,9 +141,6 @@ static void scancat(char* const out, const char* const in) { while (*++p) *q++ = (*p == '^') ? '\x1D' : *p; // Convert encoded FNC1 to GS - if (*(p - 1) == '^') // Strip any trailing FNC1 - q--; - } else {