We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We package belle-sip in Fedora. We have an older version which does not use the split bctoolbox yet.
belle-sip
Fedora 38
Package builds with GCC 13.
Build the software with GCC 13.
belle_sip_utils.c: In function 'belle_sip_concat': belle_sip_utils.c:555:31: error: pointer 'result_71' may be used after 'realloc' [-Werror=use-after-free] 555 | wp = newp + (wp - result); | ~~~~^~~~~~~~~ belle_sip_utils.c:549:31: note: call to 'realloc' here 549 | newp = (char *) realloc (result, allocated); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
This seems to fix it:
diff --git a/src/belle_sip_utils.c b/src/belle_sip_utils.c index 9688a2b..51ec3e9 100644 --- a/src/belle_sip_utils.c +++ b/src/belle_sip_utils.c @@ -545,6 +545,7 @@ char * belle_sip_concat (const char *str, ...) { /* Resize the allocated memory if necessary. */ if (wp + len + 1 > result + allocated) { + ptrdiff_t wp_offset = wp - result; allocated = (allocated + len) * 2; newp = (char *) realloc (result, allocated); if (newp == NULL) @@ -552,7 +553,7 @@ char * belle_sip_concat (const char *str, ...) { free (result); return NULL; } - wp = newp + (wp - result); + wp = newp + wp_offset; result = newp; } memcpy (wp, s, len);
A similar patch is apparently needed for bctoolbox.
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Context
We package
belle-sip
in Fedora. We have an older version which does not use the split bctoolbox yet.General information
Fedora 38
Expected behaviour
Package builds with GCC 13.
To Reproduce
Build the software with GCC 13.
Additional context
This seems to fix it:
A similar patch is apparently needed for bctoolbox.
SDK logs URL
No response
The text was updated successfully, but these errors were encountered: