Commit Graph

6 Commits

Author SHA1 Message Date
Guy Harris b8375119e3 Avoid the realloc() warning from VS Code Analyzer.
It's not just worrying about the lack of a check for a null return, it's
worried about the leak.  Assign the result to a different variable and,
if the result is null, free the old data before exiting, and if it's not
null, assign the new variable to the one we're using as a pointer to the
array.

Change-Id: Ia1d5d271293e13708c35a7562a1f40671304c417
Reviewed-on: https://code.wireshark.org/review/26410
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-10 01:52:51 +00:00
Guy Harris 190b2e89c3 entry_data.type is unsigned, so print it with %u.
This should squelch a warning from VS Code Analyzer.

Change-Id: I69e528c3dfd851d287b1faebc1469cd700fa9ef5
Reviewed-on: https://code.wireshark.org/review/26402
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-09 19:28:45 +00:00
Guy Harris 5a4468ccaf Check for realloc() failing.
Unlikely, but not impossible, and should squelch a VS Code Analyzer
warning.

Change-Id: I399c08896a3f08962ca46483d47ba5f6cbe4f28e
Reviewed-on: https://code.wireshark.org/review/26400
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-09 19:10:53 +00:00
Dario Lombardo 6c077a0818 mmdbresolve: remove leak (found by clang).
Change-Id: I7de7707d75c80bc12ec2c4a30a19f6988932b0b7
Reviewed-on: https://code.wireshark.org/review/26392
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-09 16:13:12 +00:00
Gerald Combs f0fb6ee50c mmdbresolve: Process our command line arguments by hand.
Visual Studio doesn't ship with a getopt implementation, so process our
arguments ourselves. Note that if we add support for more flags we'll
probably want to use GOption.

Change-Id: Ie78204aa64321ca68f3e66195b8c39e47ca410d9
Reviewed-on: https://code.wireshark.org/review/26288
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-06 23:31:40 +00:00
Gerald Combs a1da75c554 Transition from GeoIP Legacy to MaxMindDB.
MaxMind is discontinuing its legacy databases in April in favor of
GeoIP2, which use a newer database format (MaxMind DB). The reference C
library (libmaxminddb) is available under the Apache 2.0 license which
isn't quite compatible with ours.

Add mmdbresolve, a utility that reads IPv4 and IPv6 addresses on stdin
and prints resolved information on stdout. Place it under a liberal
license (MIT) so that we can keep libmaxminddb at arm's length. Add
epan/maxmind_db.[ch], which spawns mmdbresolve and communicates with it
via stdio.

Migrate the preferences and documentation to MaxMindDB.

Change the IPv4 and IPv6 asnum fields to FT_UINT32s. Change the
geographic coordinate fields to FT_DOUBLEs.

Bug: 10658
Change-Id: I24aeed637bea1b41d173270bda413af230f4425f
Reviewed-on: https://code.wireshark.org/review/26214
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-06 18:02:21 +00:00