From 2c22f59c3f3d02ffa995bd35ec333bd712718f96 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 4 May 2016 08:59:56 +0200 Subject: Reply with error on negative geo radius. Thanks to @tidwall for reporting. Close #3194. --- src/geo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/geo.c') diff --git a/src/geo.c b/src/geo.c index 8f6e3f645..2d351d8e0 100644 --- a/src/geo.c +++ b/src/geo.c @@ -157,7 +157,10 @@ double extractDistanceOrReply(client *c, robj **argv, } double to_meters = extractUnitOrReply(c,argv[1]); - if (to_meters < 0) return -1; + if (to_meters < 0) { + addReplyError(c,"radius cannot be negative"); + return -1; + } if (conversion) *conversion = to_meters; return distance * to_meters; -- cgit v1.2.1