Description
Fusion includes a function called "TokenizeString" that splits a string into a vector of tokens. There are two places in the code where this function is called and the resulting vector's size is not checked before it is accessed.
The two places where the bounds are not checked are:
JsonUtils.cpp, in the function "LookAtJson". It is assumed that "tokens" will have at least 3 elements, but this is not checked.
geaddtomapproject.cpp, when processing command line arguments in the main function. It is assumed that "tokens" will have at least 1 element, but this is not checked.
Steps To Reproduce
These bugs were found through code inspection.
geaddtomapproject.cpp
genewmapproject -o testproject
geaddtomapproject -o testproject "" -> segfault
JsonUtils.cpp
Drop a pin in google earth and save the point to create a kml/kmz with a single point in it
Create a vector resources. CAHighways from the tutorial set is fine
Create a vector project
Add the resource to the project. Modify the layer properties and set the look at field using the point you created in step 1
Build the vector project
Edit the dbroot.kva/ver001/dbrootconfig.xml file for the vector project you just built. Find the xml element look_at. Change the value from the pipe delimited value to a single integer, something like 123
Restart gefusion(this step may not be necessary)
Build a globe using the now corrupted vector project
Run geserveradmin --adddb and --pushdb for the globe you just built
Run geserveradmin --publishdb for the globe you just built. This step will fail with a no status returned message
Inspect the log file at /opt/google/gehttpd/logs/error_log to see the seg fault message
Description Fusion includes a function called "TokenizeString" that splits a string into a vector of tokens. There are two places in the code where this function is called and the resulting vector's size is not checked before it is accessed.
The two places where the bounds are not checked are:
JsonUtils.cpp, in the function "LookAtJson". It is assumed that "tokens" will have at least 3 elements, but this is not checked.
geaddtomapproject.cpp, when processing command line arguments in the main function. It is assumed that "tokens" will have at least 1 element, but this is not checked.
Steps To Reproduce
These bugs were found through code inspection.
geaddtomapproject.cpp
JsonUtils.cpp