diff options
author | antirez <antirez@gmail.com> | 2015-07-06 18:39:25 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2015-07-06 18:39:25 +0200 |
commit | 5e04189887ed9100577374cede428c62d23fabe4 (patch) | |
tree | 977724fae62ccf1326d12bc79e55e546601a4807 /src/geo.c | |
parent | 5254c2d3c350f4edbb2f5dfde506fcb1ec58ee66 (diff) | |
download | redis-5e04189887ed9100577374cede428c62d23fabe4.tar.gz |
Geo: validate long,lat passed by user via API
Diffstat (limited to 'src/geo.c')
-rw-r--r-- | src/geo.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -98,6 +98,12 @@ int extractLongLatOrReply(redisClient *c, robj **argv, REDIS_OK) { return REDIS_ERR; } + if (xy[0] < GEO_LONG_MIN || xy[0] > GEO_LONG_MAX || + xy[1] < GEO_LAT_MIN || xy[1] > GEO_LAT_MAX) { + addReplySds(c, sdscatprintf(sdsempty(), + "-ERR invalid longitude,latitude pair %f,%f\r\n",xy[0],xy[1])); + return REDIS_ERR; + } } return REDIS_OK; } |