canonical / dqlite

Embeddable, replicated and fault-tolerant SQL engine.
https://dqlite.io
Other
3.8k stars 215 forks source link

vfs: Fix buggy database filename comparison #509

Closed cole-miller closed 1 year ago

cole-miller commented 1 year ago

Before this change, a call to vfsDatabaseLookup with filename "blah" could end up opening a database named "blahblah" (n = strlen("blah") = 4, strncmp("blah", "blahblah", 4) = 0).

Signed-off-by: Cole Miller cole.miller@canonical.com

codecov[bot] commented 1 year ago

Codecov Report

Merging #509 (345a655) into master (654fe09) will decrease coverage by 0.01%. The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #509      +/-   ##
==========================================
- Coverage   61.03%   61.02%   -0.01%     
==========================================
  Files          34       34              
  Lines        6349     6350       +1     
  Branches     1886     1887       +1     
==========================================
  Hits         3875     3875              
  Misses       1293     1293              
- Partials     1181     1182       +1     
Impacted Files Coverage Δ
src/vfs.c 77.22% <50.00%> (-0.05%) :arrow_down: