Protect DotCode from dimensions smaller than 5

This commit is contained in:
Robin Stuart 2017-09-30 17:14:45 +01:00
parent 411f083f57
commit 4c1c180fbf

View File

@ -1282,7 +1282,12 @@ int dotcode(struct zint_symbol *symbol, const unsigned char source[], int length
} }
if ((height > 200) || (width > 200)) { 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; return ZINT_ERROR_INVALID_OPTION;
} }