Commit 34a1ebf1 authored by 's avatar
Browse files

fixed a seg fault in mapi_stats()

git-svn-id: file:///home/svn/mapi/trunk@1255 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent eb201cb0
......@@ -530,8 +530,8 @@ void *mapiipc_comm_thread(void *host){ // reads an IPC message - blocking call
for (fnode=flist_head(((struct host*)host)->stats); fnode!=NULL; fnode=flist_next(fnode)) {
stat=(struct mapi_stat*)fnode->data;
if ( strcmp((char*)dbuf->data+sizeof(struct mapi_stat), stat->dev)==0 ) {
strcpy(((struct mapi_stat*)dbuf->data)->hostname, stat->hostname);
strcpy(((struct mapi_stat*)dbuf->data)->dev, stat->dev);
((struct mapi_stat*)dbuf->data)->hostname = strdup(stat->hostname);
((struct mapi_stat*)dbuf->data)->dev = strdup(stat->dev);
memcpy(stat, dbuf->data, sizeof(struct mapi_stat));
flist_remove(((struct host*)host)->stats, fnode->id);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment