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

SRombauts / SQLiteCpp / 28478122417
100%

Build:
DEFAULT BRANCH: master
Ran 30 Jun 2026 09:50PM UTC
Jobs 1
Files 14
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

30 Jun 2026 09:49PM UTC coverage: 99.688% (-0.02%) from 99.711%
28478122417

push

github

web-flow
Fix Database::getHeaderInfo() signed-shift UB and use fixed-width Header types (#558)

## Summary

Fixes two findings from the deep code review (DB-02, DB-03) in
`Database::getHeaderInfo()` and the public `Header` struct.

### DB-02 — signed left-shift UB in the big-endian assembly
The multi-byte header fields were assembled from `unsigned char`
operands, which promote to `int` before the `<< 24` shift. For any byte
with the high bit set this is signed-left-shift undefined behaviour, and
the `int` result was then sign-extended when widened to the (LP64)
`unsigned long` fields.

Each byte is now cast to `std::uint32_t` before shifting, through a
small local `readBE32` helper that also collapses the 14 repeated 4-line
blocks.

### DB-03 — platform-variable field widths
`Header` used `unsigned long`, which is 32-bit on LLP64 (Windows) but
64-bit on LP64 (Linux/macOS), so the struct layout and field widths
differed across platforms. The struct now uses fixed-width `<cstdint>`
types (`std::uint8_t` / `std::uint32_t`).

## Test plan
- Built `SQLiteCpp_tests` (MSVC, Debug) — clean.
- `ctest -C Debug` — 100% passed, including `Database.getHeaderInfo`.

No public API behaviour changes; the parsed values are identical, only
the field types and the (previously UB) assembly path change.

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

639 of 641 relevant lines covered (99.69%)

34.22 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28478122417.1 30 Jun 2026 09:50PM UTC 14
99.69
GitHub Action Run
Source Files on build 28478122417
  • Tree
  • List 14
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28478122417
  • 6c7a96fb on github
  • Prev Build on master (#28451320988)
  • Next Build on master (#28507929241)
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