diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-08-27 14:58:02 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-08-27 14:58:02 -0300 |
| commit | 934fdd481ced3a9d4a7aaace4479ce889ab23582 (patch) | |
| tree | 2e136fa443b16ffe42a17066b1ede97b0741716b | |
| parent | 9ac9d23f4164fc7e1eeea8a3e8d4e453dade51ab (diff) | |
| download | lua-v5.4.tar.gz lua-v5.4.tar.bz2 lua-v5.4.zip | |
Bug: Constructors with nils can overflow countersv5.4
| -rw-r--r-- | lparser.c | 2 |
1 files changed, 2 insertions, 0 deletions
| @@ -940,6 +940,8 @@ static void constructor (LexState *ls, expdesc *t) { | |||
| 940 | if (ls->t.token == '}') break; | 940 | if (ls->t.token == '}') break; |
| 941 | closelistfield(fs, &cc); | 941 | closelistfield(fs, &cc); |
| 942 | field(ls, &cc); | 942 | field(ls, &cc); |
| 943 | checklimit(fs, cc.tostore + cc.na + cc.nh, INT_MAX/2, | ||
| 944 | "items in a constructor"); | ||
| 943 | } while (testnext(ls, ',') || testnext(ls, ';')); | 945 | } while (testnext(ls, ',') || testnext(ls, ';')); |
| 944 | check_match(ls, '}', '{', line); | 946 | check_match(ls, '}', '{', line); |
| 945 | lastlistfield(fs, &cc); | 947 | lastlistfield(fs, &cc); |
