[OpenWrt-Devel] [PATCH v2 1/7] fix subscriber response segfault

Bjørn Mork bjorn at mork.no
Wed Apr 8 09:31:18 EDT 2015


Signed-off-by: Bjørn Mork <bjorn at mork.no>
---
 cli.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
 	}
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list