Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
0c0fbcbd
Commit
0c0fbcbd
authored
Aug 24, 2021
by
Antoine Kaufmann
Browse files
dist/sockets: validate postion when sending entries (for debug)
parent
59abd0fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
dist/sockets/net_sockets.c
dist/sockets/net_sockets.c
+7
-0
No files found.
dist/sockets/net_sockets.c
View file @
0c0fbcbd
...
@@ -499,6 +499,13 @@ int NetOpPassEntries(struct Peer *peer, uint32_t pos, uint32_t n) {
...
@@ -499,6 +499,13 @@ int NetOpPassEntries(struct Peer *peer, uint32_t pos, uint32_t n) {
abort
();
abort
();
}
}
if
((
peer
->
last_sent_pos
+
1
)
%
peer
->
local_enum
!=
pos
)
{
fprintf
(
stderr
,
"NetOpPassEntries: entry sent repeatedly: p=%u n=%u
\n
"
,
pos
,
n
);
abort
();
}
peer
->
last_sent_pos
=
pos
+
n
-
1
;
struct
SockMsg
*
msg
=
SockMsgAlloc
();
struct
SockMsg
*
msg
=
SockMsgAlloc
();
if
(
!
msg
)
if
(
!
msg
)
return
1
;
return
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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