Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmp_tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Loidolt
cmp_tool
Commits
2efc6de7
Commit
2efc6de7
authored
3 years ago
by
Dominik Loidolt
Browse files
Options
Downloads
Plain Diff
Merge branch 'prevent_undefined_behavior' into 'master'
prevent undefined behavior See merge request
!10
parents
56a57c68
ce27b779
No related branches found
Branches containing commit
Tags
v0.08
Tags containing commit
1 merge request
!10
prevent undefined behavior
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/rmap.c
+9
-4
9 additions, 4 deletions
lib/rmap.c
with
9 additions
and
4 deletions
lib/rmap.c
+
9
−
4
View file @
2efc6de7
...
...
@@ -288,11 +288,13 @@ int rmap_set_reply_path(struct rmap_pkt *pkt, const uint8_t *rpath, uint8_t len)
pkt
->
rpath_len
=
len
;
pkt
->
rpath
=
(
uint8_t
*
)
malloc
(
pkt
->
rpath_len
);
if
(
!
pkt
->
rpath
)
return
-
1
;
if
(
len
)
{
pkt
->
rpath
=
(
uint8_t
*
)
malloc
(
pkt
->
rpath_len
);
if
(
!
pkt
->
rpath
)
return
-
1
;
memcpy
(
pkt
->
rpath
,
rpath
,
pkt
->
rpath_len
);
memcpy
(
pkt
->
rpath
,
rpath
,
pkt
->
rpath_len
);
}
/* number of 32 bit words needed to contain the path */
pkt
->
ri
.
reply_addr_len
=
len
>>
2
;
...
...
@@ -326,6 +328,9 @@ int rmap_set_dest_path(struct rmap_pkt *pkt, const uint8_t *path, uint8_t len)
pkt
->
path_len
=
len
;
if
(
!
len
)
return
0
;
pkt
->
path
=
(
uint8_t
*
)
malloc
(
pkt
->
path_len
);
if
(
!
pkt
->
path
)
return
-
1
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment