diff options
| author | Richard Nyberg <rnyberg@murmeldjur.se> | 2006-02-11 18:25:08 +0000 |
|---|---|---|
| committer | Richard Nyberg <rnyberg@murmeldjur.se> | 2006-02-11 18:25:08 +0000 |
| commit | eb85993c8c7a780d896dbe8f06b7e4ad256b327c (patch) | |
| tree | 9e98eac68db51845fcf5ee90c28d308272a37890 | |
| parent | 2ee5eed0623127c14df712df7187d41929725235 (diff) | |
| download | btpd-eb85993c8c7a780d896dbe8f06b7e4ad256b327c.tar.gz btpd-eb85993c8c7a780d896dbe8f06b7e4ad256b327c.zip | |
Don't allow a negative cm_alloc_size to wreak havoc.
| -rw-r--r-- | btpd/content.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |