lib: coerce -0 to +0 in various APIs#63556
Conversation
|
Review requested:
|
| validateUint32(interval, 'interval'); | ||
| // Coerce -0 to +0. | ||
| interval += 0; |
There was a problem hiding this comment.
Shouldn't we update validateUint32 to reject -0 instead?
There was a problem hiding this comment.
I have no particular sympathy for either or.
There was a problem hiding this comment.
Having it part of the helper is probably more robust than relying on humans to remember for checking for -0
There was a problem hiding this comment.
Having it part of the helper is probably more robust than relying on humans to remember for checking for
-0
Maybe even have it part of all uint conversion helpers?
There was a problem hiding this comment.
we can certainly start blanket rejecting -0 from these validators in a semver-major followup if you feel like picking it up. #63531 already went the same route of this PR and is in the commit-queue
There was a problem hiding this comment.
@panva check out this comment: #63531 (comment)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #63556 +/- ##
=======================================
Coverage 90.32% 90.33%
=======================================
Files 730 730
Lines 234653 234723 +70
Branches 43940 43960 +20
=======================================
+ Hits 211953 212027 +74
Misses 14414 14414
+ Partials 8286 8282 -4
🚀 New features to boost your workflow:
|
ljharb
left a comment
There was a problem hiding this comment.
i think fixing the C++ side also is a good idea, but can/should be done separately
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: Filip Skokan <[email protected]>
Signed-off-by: Filip Skokan <[email protected]>
Signed-off-by: Filip Skokan <[email protected]>
Signed-off-by: Filip Skokan <[email protected]>
Signed-off-by: Filip Skokan <[email protected]>
bb206e1 to
ae9e27c
Compare
1b1223e to
df6c598
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
f954c07 to
d3df485
Compare
| try { | ||
| fn(); | ||
| } catch { | ||
| // Ignore expected file system errors from the missing path. |
There was a problem hiding this comment.
Shouldn't we assert we actually got here? (ie. common must call etc)
|
Landed in 040c51c...9e58d9d |
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
Signed-off-by: Filip Skokan <[email protected]> PR-URL: #63556 Backport-PR-URL: #64629 Reviewed-By: Antoine du Hamel <[email protected]>
Followup to #63531
This is not an exhaustive list of these occurences, just the ones I can remotely imagine being exposed to an untrusted user input through a web-based or CLI interface.
The tests demonstrate the process crashing before the
./libchanges.I used Codex to find and confirm these before diving in.