Fixed core dumps when closing unintialized mongo or sqlite log instances

Fixed a Host header bug in sinqhttpopt
This commit is contained in:
2016-04-08 11:24:02 +02:00
parent 1087dd6c8d
commit 1fb85ef6b5
4 changed files with 16 additions and 11 deletions

View File

@ -86,6 +86,7 @@ int sicslogQuery(int argc, char *argv[], ResultCallback_t func, void *userData)
/*
parse options
*/
optind = 1;
while((c = getopt(argc,argv,"s:l:f:t:i:e:c:")) != -1) {
switch (c){
case 's':
@ -151,7 +152,7 @@ int sicslogQuery(int argc, char *argv[], ResultCallback_t func, void *userData)
/*
build the query
*/
snprintf(jsonQuery, sizeof(jsonQuery),"{ \"timestamp\" : {\"$gt\": %ld, \"$lt\": %ld}, \"severity\": {\"$lt\": %d}",
snprintf(jsonQuery, sizeof(jsonQuery),"{ \"timestamp\" : {\"$gt\": %ld, \"$lt\": %ld}, \"severity\": {\"$lte\": %d}",
from,to,severity-1);
if(sub != NULL){
snprintf(subQuery,sizeof(subQuery),", \"sub\" : \"%s\"", sub);