From eb85993c8c7a780d896dbe8f06b7e4ad256b327c Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Sat, 11 Feb 2006 18:25:08 +0000 Subject: Don't allow a negative cm_alloc_size to wreak havoc. --- btpd/content.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btpd/content.c b/btpd/content.c index ba1f354..d5177b1 100644 --- a/btpd/content.c +++ b/btpd/content.c @@ -362,7 +362,7 @@ cm_prealloc(struct torrent *tp, uint32_t piece) { struct content *cm = tp->cm; - if (cm_alloc_size == 0) + if (cm_alloc_size <= 0) set_bit(cm->pos_field, piece); else { unsigned npieces = ceil((double)cm_alloc_size / tp->meta.piece_length); -- cgit 1.4.1