Fixes:

../git/drivers/ubloxmodem/gprs-context.c: In function 
‘ublox_gprs_activate_primary’:
../git/drivers/ubloxmodem/gprs-context.c:339:2: error: ‘auth’ may be used 
uninitialized in this function [-Werror=maybe-uninitialized]
  snprintf(buf, sizeof(buf), "AT+UAUTHREQ=%u,%u,\"%s\",\"%s\"",
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    gcd->active_context, auth, username, password);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../git/drivers/ubloxmodem/gprs-context.c:324:11: note: ‘auth’ was declared here
  unsigned auth;
           ^~~~
---
 drivers/ubloxmodem/gprs-context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ubloxmodem/gprs-context.c 
b/drivers/ubloxmodem/gprs-context.c
index 489f31e8..c5b789b6 100644
--- a/drivers/ubloxmodem/gprs-context.c
+++ b/drivers/ubloxmodem/gprs-context.c
@@ -321,7 +321,7 @@ static void ublox_send_uauthreq(struct ofono_gprs_context 
*gc,
 {
        struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
        char buf[UBLOX_MAX_USER_LEN + UBLOX_MAX_PASS_LEN + 32];
-       unsigned auth;
+       unsigned auth = 0;
 
        switch (auth_method) {
        case OFONO_GPRS_AUTH_METHOD_PAP:
-- 
2.22.0

_______________________________________________
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to