Skip to content

Commit ec081ba

Browse files
committed
Set limits on parsed msglen
1 parent 0ec8321 commit ec081ba

25 files changed

Lines changed: 112 additions & 42 deletions

CHANGES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
XXXX-XX-XX
2+
3+
* The QR Code, Aztec Code, Ultracode, PDF417, MicroPDF417, MaxiCode, Data Matrix, Han Xin Code, Code One and Codablock F encoders were amended to bound their parsed message length.
4+
* The DotCode encoder was amedned to cap the rows and columns options at 200.
5+
6+
17
2026-05-06
28

39
* The D3 AQR encoder was amended to invert the p0 parity module.

src/azteccode.ps.src

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ begin
366366
} if
367367

368368
barcode length 20000 gt {
369-
/bwipp.azteccodeinputTooLong (The input data is too long) //raiseerror exec
369+
/bwipp.azteccodeInputTooLong (The input data is too long) //raiseerror exec
370370
} if
371371

372372
eclevel 5 lt eclevel 95 gt or {
@@ -442,6 +442,11 @@ begin
442442
barcode fncvals //parseinput exec /msg exch def
443443
/msglen msg length def
444444

445+
% Absolute capacity is 32-layer full at eclevel=5 ecaddchars=3, numeric.
446+
msglen 4729 gt {
447+
/bwipp.azteccodeInputTooLong (The input data is too long) //raiseerror exec
448+
} if
449+
445450
(input.preprocess) //azteccode.after exec
446451

447452
%

src/codablockf.ps.src

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ begin
259259
counttomark array astore /msg exch def pop
260260
/msglen msg length def
261261

262+
% Absolute capacity is 62 columns x 44 rows numeric.
263+
msglen 5452 gt {
264+
/bwipp.codablockfinputTooLong (The input data is too long) //raiseerror exec
265+
} if
266+
262267
%
263268
% Determine digit runlength and characters from given position
264269
%

src/codeone.ps.src

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ begin
404404
/barcode exch def
405405

406406
barcode length 4000 gt {
407-
/bwipp.codeoneinputTooLong (The input data is too long) //raiseerror exec
407+
/bwipp.codeoneInputTooLong (The input data is too long) //raiseerror exec
408408
} if
409409

410410
/_render
@@ -594,6 +594,11 @@ begin
594594
/msglen msg length def
595595
} if
596596

597+
% Absolute capacity is H format numeric.
598+
msglen 3550 gt {
599+
/bwipp.codeoneInputTooLong (The input data is too long) //raiseerror exec
600+
} if
601+
597602
(input.preprocess) //codeone.after exec
598603

599604
(input.encoding.non_stype) //codeone.before exec

src/datamatrix.ps.src

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ begin
423423
} if
424424

425425
barcode length 15000 gt {
426-
/bwipp.datamatrixinputTooLong (The input data is too long) //raiseerror exec
426+
/bwipp.datamatrixInputTooLong (The input data is too long) //raiseerror exec
427427
} if
428428

429429
version (unset) ne rows 0 ne columns 0 ne or and {
@@ -570,6 +570,11 @@ begin
570570
} if
571571
/msglen msg length def
572572

573+
% Absolute capacity is 144x144 numeric.
574+
msglen 3116 gt {
575+
/bwipp.datamatrixInputTooLong (The input data is too long) //raiseerror exec
576+
} if
577+
573578
(input.preprocess) //datamatrix.after exec
574579

575580
%

src/dotcode.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ begin
278278

279279
/barcode exch def
280280

281-
barcode length 4000 gt {
281+
barcode length 2000 gt {
282282
/bwipp.dotcodeinputTooLong (The input data is too long) //raiseerror exec
283283
} if
284284

src/gs1dotcode.ps.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ begin
7373

7474
/barcode exch def
7575

76-
barcode length 4000 gt {
76+
barcode length 2000 gt {
7777
/bwipp.gs1dotcodeinputTooLong (The input data is too long) //raiseerror exec
7878
} if
7979

src/hanxin.ps.src

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,11 @@ begin
702702
} if
703703
} if
704704

705+
% Absolute capacity is version 84 eclevel=L1 numeric.
706+
msglen 7827 gt {
707+
/bwipp.hanxinInputTooLong (The input data is too long) //raiseerror exec
708+
} if
709+
705710
%
706711
% Outside GS1 mode, FNC1 defined as having no encoding
707712
%

src/maxicode.ps.src

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ begin
375375

376376
% 93 max alphanumeric; 4x for ^NNN parse expansion
377377
barcode length 1000 gt {
378-
/bwipp.maxicodeinputTooLong (The input data is too long) //raiseerror exec
378+
/bwipp.maxicodeInputTooLong (The input data is too long) //raiseerror exec
379379
} if
380380

381381
mode -1 ne mode 2 lt mode 6 gt or and {
@@ -518,6 +518,11 @@ begin
518518

519519
} if
520520

521+
% Absolute capacity is mode 4/6 numeric.
522+
msglen 138 gt {
523+
/bwipp.maxicodeInputTooLong (The input data is too long) //raiseerror exec
524+
} if
525+
521526
(input.preprocess) //maxicode.after exec
522527

523528
(input.encoding) //maxicode.before exec

src/micropdf417.ps.src

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,11 @@ begin
790790
} if
791791
/msglen msg length def
792792

793+
% Absolute capacity is 4x44 numeric.
794+
msglen 366 gt {
795+
/bwipp.micropdf417inputTooLong (The input data is too long) //raiseerror exec
796+
} if
797+
793798
(input.preprocess) //micropdf417.after exec
794799

795800
(input.encoding) //micropdf417.before exec

0 commit comments

Comments
 (0)