-
Notifications
You must be signed in to change notification settings - Fork 1.4k
zebra: Coverity issue (Null pointer dereference -med severity) #19907
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
base: master
Are you sure you want to change the base?
Conversation
This commit addresses null pointer dereference in zebra/zebra_rib.c CID 18943 : Dereference null return value (NULL_RETURNS) dereference: Dereferencing nhg, which is known to be NULL. Description: Handled null check accordingly. Signed-off-by: Harini Subramanian <[email protected]>
| int result; | ||
| struct route_node *rn = rib_find_rn_from_ctx(ctx); | ||
|
|
||
| if (!rn) { |
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.
maybe the right thing to do here is to extract the prefix info from the ctx?
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.
from your comment , i tired to understand, i should take prefix itself, which may lead to below lines of code changes, is the below understanding correct ? can i proceed the changes like below, or something else u meant?
int zsend_route_notify_owner_ctx(const struct zebra_dplane_ctx *ctx,
enum zapi_route_notify_owner note)
{
const struct prefix *dest_p, *src_p;
/* Extract prefix information directly from context */
**dest_p = dplane_ctx_get_dest(ctx);
src_p = dplane_ctx_get_src(ctx);
return route_notify_internal(dest_p, src_p, dplane_ctx_get_type(ctx),**
dplane_ctx_get_instance(ctx),
dplane_ctx_get_vrf(ctx),
dplane_ctx_get_table(ctx), note,
dplane_ctx_get_afi(ctx),
dplane_ctx_get_safi(ctx));
}
in that api **route_notify_internal(const struct prefix dest_p,
const struct prefix src_p,
int type, uint16_t instance,
vrf_id_t vrf_id, uint32_t table_id,
enum zapi_route_notify_owner note,
afi_t afi, safi_t safi)
{
stream_put(s, ¬e, sizeof(note));
**stream_putc(s, dest_p->family);
blen = prefix_blen(dest_p);
stream_putc(s, dest_p->prefixlen);
stream_put(s, &dest_p->u.prefix, blen);**
if (!src_p) {
**src_dummy.family = dest_p->family;**
src_p = &src_dummy;
}
5a35e0a to
138387e
Compare
|
Hey, don't mean to be blunt, but ... why did you close this, without any explanation? I spent time reviewing it - was that just wasted time? should reviewers just ignore future PRs from you? |
|
ci:rerun |
sorry , i am new to community, my intention was not to ignore your comments, i thought of separating this PR into two PR's for easier review/approval . I got to know the procedure now, reopened this PR again , will ensure not to make this mistake again. Thanks |
This commit addresses null pointer dereference in zebra/zebra_evpn_neigh.c CID 72714: Dereference null return value (NULL_RETURNS) dereference: Dereferencing zvrf, which is known to be NULL. Description: Handled null check accordingly. Signed-off-by: Harini Subramanian <[email protected]>
This commit addresses null pointer dereference in zebra/zebra_evpn.c CID 72706: Dereference before null check (REVERSE_INULL) check_after_deref: Null-checking macaddr suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Description: Handled null check accordingly. Signed-off-by: Harini Subramanian <[email protected]>
This commit addresses null pointer dereference in zebra/zapi_msg.c CID 71721: Dereference null return value (NULL_RETURNS) dereference: Dereferencing a pointer that might be NULL rn when calling route_notify_internal. Description: Handled null check accordingly. Signed-off-by: Harini Subramanian <[email protected]>
This commit addresses null pointer dereference in zebra/zebra_router.c CID 109575: Dereference null return value (NULL_RETURNS) dereference: Dereferencing zrt, which is known to be NULL. Description: Handled null check accordingly. Signed-off-by: Harini Subramanian <[email protected]>
This commit addresses null pointer dereference in zebra/zebra_nhg.c CID 90819: Dereference null return value (NULL_RETURNS) dereference: Dereferencing a pointer that might be NULL new when calling zebra_nhg_increment_ref. Description: Handled null check accordingly. Signed-off-by: Harini Subramanian <[email protected]>
This commit addresses null pointer dereference in zebra/kernel_netlink.c CID 109898: Dereference null return value (NULL_RETURNS) dereference: Dereferencing a pointer that might be NULL nest when calling nl_attr_nest_end. Description: Handled null check accordingly. Signed-off-by: Harini Subramanian <[email protected]>
|
@Mergifyio backport dev/10.5 stable/10.4 stable/10.3 |
🟠 Waiting for conditions to match
|
This commit addresses null pointer dereference in zebra folder.
Description:
Handled null check accordingly.