Skip to content

Commit bc9a577

Browse files
tniessendanielleadams
authored andcommitted
src: check return value of ftell()
If ftell() returns -1L, abort instead of passing static_cast<size_t>(-1) to the vector allocator and fread(). Refs: #46463 PR-URL: #46495 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent b3b3b33 commit bc9a577

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/node_snapshotable.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ bool SnapshotData::FromBlob(SnapshotData* out, FILE* in) {
867867
int err = fseek(in, 0, SEEK_END);
868868
CHECK_EQ(err, 0);
869869
size_t size = ftell(in);
870+
CHECK_NE(size, static_cast<size_t>(-1L));
870871
err = fseek(in, 0, SEEK_SET);
871872
CHECK_EQ(err, 0);
872873

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy