From: Bjørn Mork Date: Wed, 8 Apr 2015 13:31:18 +0000 (+0200) Subject: fix subscriber response segfault X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7e534da0158d1d4ebe27285d8c9e2f49502ece74;p=oweals%2Fumbim.git fix subscriber response segfault Signed-off-by: Bjørn Mork --- diff --git a/cli.c b/cli.c index e6b34d7..cb107b7 100644 --- 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); }