GNOME Bugzilla – Bug 783788
Array limits not properly checked
Last modified: 2017-07-02 17:00:10 UTC
1. ../src/profile-migrator/ephy-profile-migrator.c:579]: (style) Array index 'i' is used before limits check. Source code is for (i = 0; locales[i] && i < *best_match; i++) { 2. for (i = 0; uris[i] != NULL && i < INSANE_NUMBER_OF_URLS; i++) { Suggest sanity check array indexes before use, not after.
Nice, I think these are both real bugs. What tool did you use to find these?
(In reply to Michael Catanzaro from comment #1) > Nice, I think these are both real bugs. Thanks. > What tool did you use to find these? A static analyser for C and C++ called cppcheck. I find it very useful. It is available from sourceforge. http://cppcheck.sourceforge.net/
The following fixes have been pushed: ab33eeb profile-migrator: Check limit before dereferencing dfaf08c notebook: Check limit before dereferencing
Created attachment 354798 [details] [review] profile-migrator: Check limit before dereferencing
Created attachment 354799 [details] [review] notebook: Check limit before dereferencing