Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nick Mathewson
Tor
Commits
b0ddaac0
Commit
b0ddaac0
authored
Sep 29, 2017
by
Nick Mathewson
🌻
Browse files
Make some assertions nonfatal to help prevent bug23690 recurrence.
parent
4e6374c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
changes/bug23690_additional_032
0 → 100644
View file @
b0ddaac0
o Minor features (robustness):
- Change several fatal assertions when flushing buffers into
non-fatal assertions, to prevent any recurrence of 23690.
src/common/buffers.c
View file @
b0ddaac0
...
...
@@ -648,8 +648,12 @@ buf_flush_to_socket(buf_t *buf, tor_socket_t s, size_t sz,
size_t
flushed
=
0
;
tor_assert
(
buf_flushlen
);
tor_assert
(
SOCKET_OK
(
s
));
tor_assert
(
*
buf_flushlen
<=
buf
->
datalen
);
tor_assert
(
sz
<=
*
buf_flushlen
);
if
(
BUG
(
*
buf_flushlen
>
buf
->
datalen
))
{
*
buf_flushlen
=
buf
->
datalen
;
}
if
(
BUG
(
sz
>
*
buf_flushlen
))
{
sz
=
*
buf_flushlen
;
}
check
();
while
(
sz
)
{
...
...
src/common/buffers_tls.c
View file @
b0ddaac0
...
...
@@ -142,8 +142,12 @@ buf_flush_to_tls(buf_t *buf, tor_tls_t *tls, size_t flushlen,
size_t
flushed
=
0
;
ssize_t
sz
;
tor_assert
(
buf_flushlen
);
tor_assert
(
*
buf_flushlen
<=
buf
->
datalen
);
tor_assert
(
flushlen
<=
*
buf_flushlen
);
if
(
BUG
(
*
buf_flushlen
>
buf
->
datalen
))
{
*
buf_flushlen
=
buf
->
datalen
;
}
if
(
BUG
(
flushlen
>
*
buf_flushlen
))
{
flushlen
=
*
buf_flushlen
;
}
sz
=
(
ssize_t
)
flushlen
;
/* we want to let tls write even if flushlen is zero, because it might
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment