Patch: Compiler warnings
"Nikos Balkanas" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <B10C224DB215420498D55D9B7A38B6D8@tardis> |
Hi, A couple of ominus compiler warnings: warning: array subscript is above array bounds At least the first one should result in an invalid write during normal operation. BR, Nikos
kannel.diff
(application/octet-stream, 1.1 KB)
Index: gwlib/log.c
===================================================================
RCS file: /home/cvs/gateway/gwlib/log.c,v
retrieving revision 1.56
diff -a -u -r1.56 log.c
--- gwlib/log.c 12 Jan 2009 16:46:54 -0000 1.56
+++ gwlib/log.c 18 Dec 2009 15:15:52 -0000
@@ -172,7 +172,7 @@
gw_rwlock_init_static(&rwlock);
/* default all possible thread to logging index 0, stderr */
- for (i = 0; i <= THREADTABLE_SIZE; i++) {
+ for (i = 0; i < THREADTABLE_SIZE; i++) {
thread_to[i] = 0;
}
Index: gw/wap_push_ppg.c
===================================================================
RCS file: /home/cvs/gateway/gw/wap_push_ppg.c,v
retrieving revision 1.76
diff -a -u -r1.76 wap_push_ppg.c
--- gw/wap_push_ppg.c 12 Jan 2009 16:46:56 -0000 1.76
+++ gw/wap_push_ppg.c 18 Dec 2009 15:15:53 -0000
@@ -2116,7 +2116,7 @@
network = (**e).u.Push_Message.network;
for (i = 0; i < NUMBER_OF_NETWORKS ; ++i) {
- if (octstr_case_compare(bearer, octstr_imm(bearers[i])) == 0)
+ if (octstr_case_compare(network, octstr_imm(networks[i])) == 0)
break;
}
for (j = 0; j < NUMBER_OF_BEARERS ; ++j) {