diff --git a/modules/database/src/std/rec/lsiRecord.c b/modules/database/src/std/rec/lsiRecord.c index 496350875..5ecceab09 100644 --- a/modules/database/src/std/rec/lsiRecord.c +++ b/modules/database/src/std/rec/lsiRecord.c @@ -49,6 +49,9 @@ static long init_record(struct dbCommon *pcommon, int pass) if (sizv < 16) { sizv = 16; /* Enforce a minimum size for the VAL field */ prec->sizv = sizv; + } else if (sizv > 0x7fff) { + sizv = 0x7fff; /* SIZV is unsigned, but dbAddr::field_size is signed */ + prec->sizv = sizv; } prec->val = callocMustSucceed(1, sizv, "lsi::init_record"); diff --git a/modules/database/src/std/rec/lsoRecord.c b/modules/database/src/std/rec/lsoRecord.c index 0f6d51640..755a0e865 100644 --- a/modules/database/src/std/rec/lsoRecord.c +++ b/modules/database/src/std/rec/lsoRecord.c @@ -53,6 +53,9 @@ static long init_record(struct dbCommon *pcommon, int pass) if (sizv < 16) { sizv = 16; /* Enforce a minimum size for the VAL field */ prec->sizv = sizv; + } else if (sizv > 0x7fff) { + sizv = 0x7fff; /* SIZV is unsigned, but dbAddr::field_size is signed */ + prec->sizv = sizv; } prec->val = callocMustSucceed(1, sizv, "lso::init_record"); diff --git a/modules/database/src/std/rec/lsoRecord.dbd.pod b/modules/database/src/std/rec/lsoRecord.dbd.pod index 0b3bc06e2..edfc9c4fc 100644 --- a/modules/database/src/std/rec/lsoRecord.dbd.pod +++ b/modules/database/src/std/rec/lsoRecord.dbd.pod @@ -41,7 +41,7 @@ C is specified, DOL is ignored, the current value of VAL is written, and VAL can be changed externally via dbPuts at run-time. The maximum number of characters in VAL is given by SIZV, and cannot be larger -than 65535. +than 32767. DOL can also be a constant instead of a link, in which case VAL is initialized to the constant value. Most simple string constants are likely to be interpreted