Browse Source

MT#61856 parse_attribute_crypto: initialize `err` at least to something

Fixes:

../lib/loglib.h:54:17: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   54 |                 __ilog(prio, "[%s] " fmt, log_level_names[system], ##__VA_ARGS__);                                              \
      |                 ^~~~~~
sdp.c:613:21: note: ‘err’ was declared here
  613 |         const char *err;
      |                     ^~~

sdp.c:734:9: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  734 |         ilog(LOG_ERROR, "Failed to parse a=crypto attribute, ignoring: %s", err);
      |         ^
sdp.c:613:21: note: ‘err’ was declared here
  613 |         const char *err;
      |                     ^

Change-Id: I18c3c1d6f2d6d5643a61ef864116e1f3d5e1db95
pull/1855/merge
Donat Zenichev 5 months ago
parent
commit
856ab5815c
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      daemon/sdp.c

+ 3
- 1
daemon/sdp.c View File

@ -610,7 +610,7 @@ static int parse_attribute_crypto(struct sdp_attribute *output) {
gsize ret;
str s;
uint32_t u32;
const char *err;
const char *err = NULL;
output->attr = ATTR_CRYPTO;
@ -731,6 +731,8 @@ static int parse_attribute_crypto(struct sdp_attribute *output) {
return 0;
error:
if (!err)
err = "generic error";
ilog(LOG_ERROR, "Failed to parse a=crypto attribute, ignoring: %s", err);
output->attr = ATTR_IGNORE;
return -1;


Loading…
Cancel
Save