#2369 check correct usage of talloc_realloc
Closed: Fixed None Opened 5 years ago by preichl.

When talloc_ralloc called with count parameter equal to zero it frees context and returns NULL. This seems to be potential source of problems as developers assumes that return value NULL implies ENOMEM.

It may be correct in some case to do something like this:

missing = talloc_realloc(mem_ctx, missing,
                         struct sdap_nested_group_member, num_missing);
-    if (missing == NULL) {
+    if (missing == NULL && num_missing != 0) {
         return ENOMEM;

One patch landed in master: 759fd29

Fields changed

keywords: => easyfix

Fields changed

milestone: NEEDS_TRIAGE => SSSD 1.14 beta
rhbz: => 0

This might be a nice task if we have time in 1.14..

mark: => 0
milestone: SSSD 1.14 beta => SSSD 1.14 backlog
sensitive: => 0

I've checked the source code, there is any case where it can happen apart from the one fixed by 759fd29.

This bug can be closed.

Thank you very much for checking. I'm closing the ticket.

owner: somebody => fidencio

Fields changed

milestone: SSSD 1.14 backlog => SSSD 1.14 alpha
resolution: => fixed
status: new => closed

Metadata Update from @preichl:
- Issue assigned to fidencio
- Issue set to the milestone: SSSD 1.14 alpha

2 years ago

Login to comment on this ticket.

Metadata