From: kibak.yoon Date: Fri, 18 Dec 2015 11:29:13 +0000 (+0900) Subject: sensord: fix the bug which index can be out of range X-Git-Tag: accepted/tizen/mobile/20151221.052204^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76c08c803d7ef495f4145656e6c475adccb1ff65;p=platform%2Fcore%2Fapi%2Fsensor.git sensord: fix the bug which index can be out of range Change-Id: Idd64bde22e2a901627cd20b46174cbb4bf6e593f Signed-off-by: kibak.yoon --- diff --git a/src/geomagnetic_field.c b/src/geomagnetic_field.c index 162abdc..e599996 100644 --- a/src/geomagnetic_field.c +++ b/src/geomagnetic_field.c @@ -198,7 +198,7 @@ GEOMG1: ar = ar*aor; for (m = 0, D3 = 1, D4 = (n+m+D3)/D3; D4 > 0; D4--, m += D3) { if (alt != oalt || glat != olat) { - if (n == m) { + if (n == m && m != 0) { *(p+n+m*13) = st**(p+n-1+(m-1)*13); dp[m][n] = st*dp[m-1][n-1]+ct**(p+n-1+(m-1)*13); goto S50;