diff --git a/VERSION b/VERSION index 83d6e3e8..48221040 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.630 +8.3.631 diff --git a/commands/CmdLQ.c b/commands/CmdLQ.c index 8f4c9727..349a1164 100644 --- a/commands/CmdLQ.c +++ b/commands/CmdLQ.c @@ -2681,14 +2681,13 @@ CmdDoProperty( } } if (proplen > 0) - { proprec = (PropertyRecord *)mallocMagic( sizeof(PropertyRecord) + (proplen - 2) * sizeof(int)); - proprec->prop_type = proptype; - proprec->prop_len = proplen; - } } + proprec->prop_type = proptype; + proprec->prop_len = proplen; + /* Second pass */ value = cmd->tx_argv[argstart + 1]; for (proplen = 0; proplen < proprec->prop_len; proplen++) diff --git a/database/DBio.c b/database/DBio.c index 70fc0f63..22e81bdd 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -2594,7 +2594,16 @@ dbReadProperties(cellDef, line, len, f, scalen, scaled) while (isspace(*pptr) && (*pptr != '\0')) pptr++; if (!isspace(*pptr)) { - sscanf(pptr, "%d", &ival); + if (sscanf(pptr, "%d", &ival) != 1) + { + TxError("Mask-hint \"%s\" has non-integer values!", + pptr); + DBFreePaintPlane(proprec->prop_value.prop_plane); + TiFreePlane(proprec->prop_value.prop_plane); + freeMagic((char *)proprec); + proprec = (PropertyRecord *)NULL; + break; + } if (scalen > 1) ival *= scalen; if (scaled > 1) ival /= scaled; switch (numvals) @@ -2622,11 +2631,11 @@ dbReadProperties(cellDef, line, len, f, scalen, scaled) } while (!isspace(*pptr) && (*pptr != '\0')) pptr++; } - if (numvals == 0) - { - TxError("Mask-hint property number of values is not" + } + if (numvals != 0) + { + TxError("Mask-hint property number of values is not" " divisible by four. Truncated.\n"); - } } (void) DBPropPut(cellDef, propertyname, proprec); }