summaryrefslogtreecommitdiffstats
path: root/chrome/browser/geolocation/gateway_data_provider_linux.cc
diff options
context:
space:
mode:
authorkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-12 17:00:52 +0000
committerkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-12 17:00:52 +0000
commit72f891f407cc2ccd132328e97f1b4dd5eaab72b2 (patch)
tree92d8cc652d284024de6ea0a50e16888e03babaef /chrome/browser/geolocation/gateway_data_provider_linux.cc
parentb2b0fceea58bf7e13cc73020133aff6d6b4f4640 (diff)
downloadchromium_src-72f891f407cc2ccd132328e97f1b4dd5eaab72b2.zip
chromium_src-72f891f407cc2ccd132328e97f1b4dd5eaab72b2.tar.gz
chromium_src-72f891f407cc2ccd132328e97f1b4dd5eaab72b2.tar.bz2
Coverity: Fix unchecked return values.
CID=13943, 13746, 13749, 13597, 13249, 13145, 12875, 12874, 12871, 12438, 12436, 12431 BUG=none TEST=none Review URL: http://codereview.chromium.org/6076006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/geolocation/gateway_data_provider_linux.cc')
-rw-r--r--chrome/browser/geolocation/gateway_data_provider_linux.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/geolocation/gateway_data_provider_linux.cc b/chrome/browser/geolocation/gateway_data_provider_linux.cc
index f1779cb..e8f8cf4 100644
--- a/chrome/browser/geolocation/gateway_data_provider_linux.cc
+++ b/chrome/browser/geolocation/gateway_data_provider_linux.cc
@@ -40,9 +40,10 @@ std::string HexToIpv4Format(std::string& hex_address) {
if (hex_address.size() != 8)
return "";
std::vector<uint8> bytes;
- base::HexStringToBytes(hex_address, &bytes);
- if (bytes.size() != 4)
+ if (!base::HexStringToBytes(hex_address, &bytes) ||
+ bytes.size() != 4) {
return "";
+ }
struct in_addr in;
uint32 ip_native_endian;
memcpy(&ip_native_endian, &bytes[0], 4);