GNOME Bugzilla – Bug 494096
acess the element beyond the bounds of an array cause evolution to crash
Last modified: 2007-11-13 16:29:06 UTC
In the code of libical/src/libical/icaltz-util.c:find_transidx, there is a possibility of acessing the element beyond the bounds of the trans_idx. 134 for (i = 0; i < num_trans; i++) { 135 if (now < transitions [i]) { 136 found = 1; 137 break; 138 } 139 } Assume num_trans is 4, and if the now < transitions[i] is true when i is 3, in the code 147 idx = trans_idx [i]; 148 types [idx].isdst ? (*dstidx = i) : (*stdidx = i); 149 150 if (i >= num_trans) 151 i--; 152 else 153 i++; 154 155 idx = trans_idx [i]; 156 types [idx].isdst ? (*dstidx = i) : (*stdidx = i); line 153 will be executed and then i will be 4 which is invalid and trans_idx[i](trans_idx[4]) is not a valid element in the trans_idx array.
Created attachment 98646 [details] [review] patch to fix the bug
*** This bug has been marked as a duplicate of 492426 ***