mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
GCC12: Fixes for 16+
Most issues were in stringfields and had to do with comparing a pointer to an constant/interned string with NULL. Since the string was a constant, a pointer to it could never be NULL so the comparison was always "true". gcc now complains about that. There were also a few issues where determining if there was enough space for a memcpy or s(n)printf which were fixed by defining some of the involved variables as "volatile". There were also a few other miscellaneous fixes. ASTERISK-30044 Change-Id: Ia081ca1bcfb329df6487c4660aaf1944309eb570
This commit is contained in:
committed by
Joshua Colp
parent
49108810d1
commit
4aa541683b
@@ -35420,8 +35420,8 @@ AST_TEST_DEFINE(get_in_brackets_const_test)
|
||||
ast_test_status_update(test, "Unexpected result: %d != %d\n", expected_res, res); \
|
||||
return AST_TEST_FAIL; \
|
||||
} \
|
||||
if ((expected_start) != start) { \
|
||||
const char *e = expected_start ? expected_start : "(null)"; \
|
||||
if ((void *)(expected_start) != (void *)start) { \
|
||||
const char *e = ((void *)expected_start != (void *)NULL) ? expected_start : "(null)"; \
|
||||
const char *a = start ? start : "(null)"; \
|
||||
ast_test_status_update(test, "Unexpected start: %s != %s\n", e, a); \
|
||||
return AST_TEST_FAIL; \
|
||||
|
@@ -1033,6 +1033,10 @@ int analog_call(struct analog_pvt *p, struct ast_channel *ast, const char *rdest
|
||||
ast_log(LOG_WARNING, "Number '%s' is shorter than stripmsd (%d)\n", c, p->stripmsd);
|
||||
c = NULL;
|
||||
}
|
||||
if (c && (strlen(c) > sizeof(p->dop.dialstr) - 3 /* "Tw\0" */)) {
|
||||
ast_log(LOG_WARNING, "Number '%s' is longer than %d bytes\n", c, (int)sizeof(p->dop.dialstr) - 2);
|
||||
c = NULL;
|
||||
}
|
||||
if (c) {
|
||||
p->dop.op = ANALOG_DIAL_OP_REPLACE;
|
||||
snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "Tw%s", c);
|
||||
|
Reference in New Issue
Block a user