diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index 2574ba5f8..f7dc5d20c 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -741,14 +741,17 @@ void basilisk_respond_ping(struct supernet_info *myinfo,struct iguana_peer *addr break; len += n; } - len += iguana_rwnum(1,&data[len],sizeof(sn),&sn); - char src[16],dest[16],message[128]; bits256 hash; uint64_t amount; uint32_t timestamp; - for (i=0; i %s) ",message,src,dstr(amount),dest); + if ( len < datalen-sizeof(sn) ) + { + len += iguana_rwnum(0,&data[len],sizeof(sn),&sn); + char src[16],dest[16],message[128]; bits256 hash; uint64_t amount; uint32_t timestamp; + for (i=0; i %s) ",message,src,dstr(amount),dest); + } } if ( len != datalen ) printf("PING got %d, processed.%d from (%s)\n",datalen,len,ipbuf);