• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

expressjs / body-parser / 24863842374
100%
master: 98%

Build:
Build:
LAST BUILD BRANCH: ci-node-26
DEFAULT BRANCH: master
Ran 23 Apr 2026 11:23PM UTC
Jobs 1
Files 6
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Apr 2026 11:22PM UTC coverage: 99.709%. Remained the same
24863842374

push

github

web-flow
fix: correct off-by-one error in parameterCount (#716)

* fix: correct off-by-one error in parameterCount

The `parameterCount` function was counting `&` characters but returning
that count directly. Since the number of parameters equals the number
of `&` characters plus one, this caused an off-by-one error.

For example, with `a[0]=1&a[1]=2&...&a[199]=200` (200 parameters):
- Before: returned 199 (number of `&` chars)
- After: returns 200 (actual parameter count)

This bug became visible with qs@6.14.2 which changed `arrayLimit` to
restrict array length instead of max index. With the buggy count,
large arrays would be converted to objects instead of arrays.

- Fix `parameterCount` to return the actual count of parameters

Fixes #715

* deps(qs): bump to ~6.14.2

* refactor: use 2.x do/while loop for parameterCount

The previous while loop counted '&' separators, so the return value
was (parameter count - 1). That happened to work because old qs
treated `arrayLimit` as a max-index rather than max-length. The
limit check itself was always correct, only the return value was
off relative to the function's name.

Rather than patch with `+1`, port the 2.x version where `count`
directly represents parameter count. The do/while runs once
unconditionally for the first parameter (before any '&'), then
increments per '&' found.

do/while is safe because the caller at line 74 guards empty bodies
(`body.length ? queryparse(body) : {}`). If that guard were removed,
this would incorrectly return 1 for empty input.

Simple parser is unaffected, it only checks for `undefined` and
discards the count. Only the extended parser consumed the value,
as input to qs's `arrayLimit`.

* docs: update HISTORY.md

---------

Co-authored-by: Jon Church <me@jonchurch.com>

4 of 4 new or added lines in 1 file covered. (100.0%)

343 of 344 relevant lines covered (99.71%)

8265.63 hits per line

Jobs
ID Job ID Ran Files Coverage
1 24863842374.1 23 Apr 2026 11:23PM UTC 12
99.56
GitHub Action Run
Source Files on build 24863842374
  • Tree
  • List 6
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24863842374
  • 6f24d7e8 on github
  • Prev Build on 1.x (#20739825891)
  • Next Build on 1.x (#24903155869)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc