aboutsummaryrefslogtreecommitdiffstats
path: root/epan/geoip_db.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2014-09-05 11:17:17 -0700
committerGerald Combs <gerald@wireshark.org>2014-09-17 20:04:28 +0000
commit7e638057089bb9d599cd35d4673aef70e0ae58a1 (patch)
treece2f546bac9c6c8bcac74b0d5ba0424ddefad0ca /epan/geoip_db.c
parent478fab5206bf30a639ec9ba71edff2fb6ec2cad4 (diff)
Qt: Add the "Map" button to the Endpoints dialog.
Move the map creation code from ui/gtk/hostlist_table.c to ui/traffic_table_ui.c. Add CMake commands to copy ipmap.html to the run directory so that WIRESHARK_RUN_FROM_BUILD_DIRECTORY works for the endpoint map. Not sure if they're entirely correct but they appear to work. Add boundary checkes to geoip_db_lookup_ipv[46]. To do: - It looks like there are prettier maps and newer APIs that we might want to use. Change-Id: Ie06992c9bc9c9aa683328aecab3f5f69c9cab966 Reviewed-on: https://code.wireshark.org/review/4011 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'epan/geoip_db.c')
-rw-r--r--epan/geoip_db.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/geoip_db.c b/epan/geoip_db.c
index 6aeba65f8a..070460ff7e 100644
--- a/epan/geoip_db.c
+++ b/epan/geoip_db.c
@@ -312,6 +312,9 @@ geoip_db_lookup_ipv4(guint dbnum, guint32 addr, const char *not_found) {
const char *raw_val, *ret = not_found;
char *val;
+ if (dbnum > geoip_db_num_dbs()) {
+ return ret;
+ }
gi = g_array_index(geoip_dat_arr, GeoIP *, dbnum);
if (gi) {
switch (gi->databaseType) {
@@ -423,6 +426,9 @@ geoip_db_lookup_ipv6(guint dbnum, struct e_in6_addr addr, const char *not_found)
#if NUM_DB_TYPES > 31
GeoIPRecord *gir;
#endif
+ if (dbnum > geoip_db_num_dbs()) {
+ return ret;
+ }
memcpy(&gaddr, &addr, sizeof(addr));