GNOME Bugzilla – Bug 679620
[PATCH] used array index before limits check in file doxygen-svn/src/markdown.cpp
Last modified: 2012-11-18 11:11:02 UTC
Created attachment 218325 [details] [review] proposed patch Please find attached a patch that fixes three issues, where first an array index is used and then its bound (limits) are checked. It is better to first check if the index is within the bounds and then use the index. Best regards Ettl Martin
These are not real issues! In every case the data[i] is inside a guard that already checks that i<size. Using data[i]=='-' && i<size-2 && data[i+1]=='#' && data[i+2]==' ' instead of i<size-2 && data[i]=='-' && data[i+1]=='#' && data[i+2]==' ' has a slight performance benefit as data[i] is more likely to evaluate to false.