fix subscriber response segfault
authorBjørn Mork <bjorn@mork.no>
Wed, 8 Apr 2015 13:31:18 +0000 (15:31 +0200)
committerJohn Crispin <blogic@openwrt.org>
Fri, 3 Apr 2015 08:33:02 +0000 (10:33 +0200)
Signed-off-by: Bjørn Mork <bjorn@mork.no>
cli.c

diff --git a/cli.c b/cli.c
index e6b34d77bde03c231eb177b04110b2dcd65909a9..cb107b7178f4e0f2f46d6d87fb1bb66fb6e1640b 100644 (file)
--- a/cli.c
+++ b/cli.c
@@ -152,7 +152,7 @@ mbim_subscriber_response(void *buffer, int len)
        if (le32toh(state->readyinfo) & MBIM_READY_INFO_FLAG_PROTECT_UNIQUE_ID)
                printf("  dont display subscriberID: 1\n");
        for (nr = 0; nr < le32toh(state->telephonenumberscount); nr++) {
-               struct mbim_string *str = buffer + le32toh(state->telephonenumbers) + (nr * sizeof(struct mbim_string));
+               struct mbim_string *str = (void *)&state->telephonenumbers + (nr * sizeof(struct mbim_string));
                char *number = mbim_get_string(str, buffer);
                printf("  number: %s\n", number);
        }