-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warnint 64to32 6186 v19.5 #11247
Warnint 64to32 6186 v19.5 #11247
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -368,7 +368,9 @@ static int FrameSlide(const char *ds, Frames *frames, const TcpStream *stream, c | |
} | ||
frames->cnt = x; | ||
uint64_t o = STREAM_BASE_OFFSET(stream) + slide; | ||
frames->left_edge_rel = le - (STREAM_BASE_OFFSET(stream) + slide); | ||
BUG_ON(o > le); | ||
BUG_ON(le - o > UINT32_MAX); | ||
frames->left_edge_rel = (uint32_t)(le - o); | ||
|
||
#ifdef DEBUG | ||
SCLogDebug("end: left edge %" PRIu64 ", left_edge_rel %u, stream base %" PRIu64 | ||
|
@@ -379,7 +381,6 @@ static int FrameSlide(const char *ds, Frames *frames, const TcpStream *stream, c | |
snprintf(pf, sizeof(pf), "%s:post_slide", ds); | ||
AppLayerFrameDumpForFrames(pf, frames); | ||
#endif | ||
BUG_ON(o > le); | ||
BUG_ON(x != start - removed); | ||
return 0; | ||
} | ||
|
@@ -790,15 +791,16 @@ static void FramePrune(Frames *frames, const TcpStream *stream, const bool eof) | |
} | ||
} | ||
frames->cnt = x; | ||
frames->left_edge_rel = le - STREAM_BASE_OFFSET(stream); | ||
BUG_ON(le < STREAM_BASE_OFFSET(stream)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DEBUG_VALIDATE_BUG_ON? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one was your code :
|
||
BUG_ON(le - STREAM_BASE_OFFSET(stream) > UINT32_MAX); | ||
frames->left_edge_rel = (uint32_t)(le - STREAM_BASE_OFFSET(stream)); | ||
#ifdef DEBUG | ||
SCLogDebug("end: left edge %" PRIu64 ", left_edge_rel %u, stream base %" PRIu64 | ||
", cnt %u, removed %u, start %u", | ||
(uint64_t)frames->left_edge_rel + STREAM_BASE_OFFSET(stream), frames->left_edge_rel, | ||
STREAM_BASE_OFFSET(stream), frames->cnt, removed, start); | ||
AppLayerFrameDumpForFrames("post_slide", frames); | ||
#endif | ||
BUG_ON(le < STREAM_BASE_OFFSET(stream)); | ||
if (frames->cnt > 0) { // if we removed all this can fail | ||
BUG_ON(frames_le_start > le); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ typedef struct HttpRangeContainerBuffer { | |
/** offset of bytes written in buffer (relative to the start of the range) */ | ||
uint64_t offset; | ||
/** number of gaped bytes */ | ||
uint64_t gap; | ||
uint32_t gap; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a file can be larger than 4GiB, so a gap in it's data could also exceed 4GiB There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, will saturate it... |
||
} HttpRangeContainerBuffer; | ||
|
||
int HttpRangeContainerBufferCompare(HttpRangeContainerBuffer *a, HttpRangeContainerBuffer *b); | ||
|
@@ -63,7 +63,7 @@ typedef struct HttpRangeContainerFile { | |
/** key length */ | ||
uint32_t len; | ||
/** expire time in epoch */ | ||
uint32_t expire; | ||
uint64_t expire; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice |
||
/** pointer to hashtable data, for locking and use count */ | ||
THashData *hdata; | ||
/** total expected size of the file in ranges */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should these be DEBUG_VALIDATE_BUG_ON?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok