Skip to content

Commit

Permalink
scandata: Don't strip a terminal GS present in the barcode message (a…
Browse files Browse the repository at this point in the history
…s FNC1)
  • Loading branch information
terryburton committed Jul 18, 2024
1 parent 005385d commit ac70ddc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/c-lib/gs1encoders-fuzzer-scandata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 0 additions & 3 deletions src/c-lib/scandata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down

0 comments on commit ac70ddc

Please sign in to comment.