From 9f5eabdabfc9ec1a7aebb69df74ae21fae1d3e86 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Tue, 15 Nov 2005 06:43:31 +0000 Subject: [PATCH] fix obvious error in thread enumeration --- src/configfile.c | 3 +-- src/webserver.c | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index 546b0231..a42f4d6c 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -1259,8 +1259,7 @@ void config_set_status(WS_CONNINFO *pwsc, int session, char *fmt, ...) { /* new info */ pfirst=(SCAN_STATUS*)malloc(sizeof(SCAN_STATUS)); if(pfirst) { - pfirst->what = strdup(buffer); - pfirst->session = session; + pfirst->what = NULL; pfirst->thread = pwsc->threadno; pfirst->host = strdup(pwsc->hostname); ws_set_local_storage(pwsc,pfirst,config_freescan); diff --git a/src/webserver.c b/src/webserver.c index 49ab018f..70f4d4dc 100644 --- a/src/webserver.c +++ b/src/webserver.c @@ -1573,14 +1573,16 @@ void ws_set_local_storage(WS_CONNINFO *pwsc, void *ptr, void (*callback)(void *) */ WS_CONNINFO *ws_thread_enum_first(WSHANDLE wsh, WSTHREADENUM *vpp) { WS_PRIVATE *pwsp; - WS_CONNINFO *pwsc; + WS_CONNINFO *pwsc = NULL; WS_CONNLIST *pconlist; pwsp = (WS_PRIVATE *)wsh; ws_lock_connlist(pwsp); pconlist = pwsp->connlist.next; - pwsc = pconlist->pwsc; + if(pconlist) { + pwsc = pconlist->pwsc; + } *vpp = (WSTHREADENUM)pconlist; if(pwsc == NULL) {