Skip to content

Conversation

@kalev
Copy link

@kalev kalev commented Aug 25, 2021

Found by a static analyzer.

bubblewrap-0.4.1/bubblewrap.c:1500: overwrite_var: Overwriting "opt_args_data" in "opt_args_data = load_file_data(the_fd, &data_len)" leaks the storage that "opt_args_data" points to.
 # 1498|              * keep allocated until exit time, since its argv entries get used
 # 1499|              * by the other cases in parse_args_recurse() when we recurse. */
 # 1500|->           opt_args_data = load_file_data (the_fd, &data_len);
 # 1501|             if (opt_args_data == NULL)
 # 1502|               die_with_error ("Can't read --args data");

Found by a static analyzer.

```
bubblewrap-0.4.1/bubblewrap.c:1500: overwrite_var: Overwriting "opt_args_data" in "opt_args_data = load_file_data(the_fd, &data_len)" leaks the storage that "opt_args_data" points to.
 # 1498|              * keep allocated until exit time, since its argv entries get used
 # 1499|              * by the other cases in parse_args_recurse() when we recurse. */
 # 1500|->           opt_args_data = load_file_data (the_fd, &data_len);
 # 1501|             if (opt_args_data == NULL)
 # 1502|               die_with_error ("Can't read --args data");
```
@kalev
Copy link
Author

kalev commented Aug 25, 2021

I found this in Fedora dist git and I think it makes sense to upstream the fix. @cgwalters is the author.

@kalev
Copy link
Author

kalev commented Aug 25, 2021

Ahh, looks like it's already in #426

@kalev kalev closed this Aug 25, 2021
@smcv
Copy link
Collaborator

smcv commented Aug 25, 2021

Yeah, sorry, this is not correct and needs some fixes.

@kalev
Copy link
Author

kalev commented Aug 25, 2021

Yep, I figured it out now. Sorry for the noise :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants