Skip to content
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

Fails to compile with -Werror=use-after-free enabled for recent GCC #10

Open
nodakai opened this issue Apr 22, 2024 · 0 comments
Open

Comments

@nodakai
Copy link

nodakai commented Apr 22, 2024

Looks like a real bug to me, not a false alarm.

free(vi_group);
return sc_set_err(tg, EINVAL, "ERROR: %s: Set strip_fcs=%"PRId64", but interface"
" %s set to %d\n", __func__,
attr->strip_fcs, fcs_interface,
vi_group->sc_vi_group.svg_strip_fcs);

In file included from include/sc_internal.h:26,
                 from core/internal.h:13,
                 from core/sc_vi.c:6:
core/sc_vi.c: In function 'sc_vi_group_alloc__ef_vi':
include/sc_internal/utils.h:104:3: error: pointer 'vi_group' used after 'free' [-Werror=use-after-free]
  104 |   __sc_set_err((tg), __FILE__, __LINE__, __func__, (errno_code), __VA_ARGS__)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
core/sc_vi.c:74:14: note: in expansion of macro 'sc_set_err'
   74 |       return sc_set_err(tg, EINVAL, "ERROR: %s: Set strip_fcs=%"PRId64", but interface"
      |              ^~~~~~~~~~
core/sc_vi.c:73:7: note: call to 'free' here
   73 |       free(vi_group);
      |       ^~~~~~~~~~~~~~
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

No branches or pull requests

1 participant