From 4c1c180fbfd90e703420a2c1c1bf0cf860c8b75f Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Sat, 30 Sep 2017 17:14:45 +0100 Subject: [PATCH] Protect DotCode from dimensions smaller than 5 --- backend/dotcode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/dotcode.c b/backend/dotcode.c index c26b6d27..187a1a83 100644 --- a/backend/dotcode.c +++ b/backend/dotcode.c @@ -1282,7 +1282,12 @@ int dotcode(struct zint_symbol *symbol, const unsigned char source[], int length } if ((height > 200) || (width > 200)) { - strcpy(symbol->errtxt, "526: Specified symbol size is too large (E20)"); + strcpy(symbol->errtxt, "526: Specified symbol size is too large"); + return ZINT_ERROR_INVALID_OPTION; + } + + if ((height < 5) || (width < 5)) { + strcpy(symbol->errtxt, "527: Specified symbol size has a dimension which is too small"); return ZINT_ERROR_INVALID_OPTION; }