~ubuntu-branches/ubuntu/saucy/clamav/saucy-backports

« back to all changes in this revision

Viewing changes to libclamav/mspack.c

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2014-07-15 01:08:10 UTC
  • mfrom: (0.35.47 sid)
  • Revision ID: package-import@ubuntu.com-20140715010810-ru66ek4fun2iseba
Tags: 0.98.4+dfsg-2~ubuntu13.10.1
No-change backport to saucy (LP: #1341962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <stdio.h>
27
27
#include <string.h>
28
28
 
 
29
#include <openssl/ssl.h>
 
30
#include <openssl/err.h>
 
31
#include "libclamav/crypto.h"
 
32
 
29
33
#include "others.h"
30
34
#include "clamav.h"
31
35
#include "mspack.h"
648
652
 
649
653
  /* flush out any stored-up bytes before we begin */
650
654
  i = zip->o_end - zip->o_ptr;
651
 
  if ((off_t) i > out_bytes) i = (int) out_bytes;
 
655
  if (((off_t) i > out_bytes) && ((int) out_bytes >= 0)) i = (int) out_bytes;
652
656
  if (i) {
653
657
    if (zip->wflag && (ret = mspack_write(zip->ofd, zip->o_ptr, i, zip->file)) != CL_SUCCESS) {
654
658
      return zip->error = ret;
1120
1124
 
1121
1125
  /* flush out any stored-up bytes before we begin */
1122
1126
  i = lzx->o_end - lzx->o_ptr;
1123
 
  if ((off_t) i > out_bytes) i = (int) out_bytes;
 
1127
  if (((off_t) i > out_bytes) && ((int) out_bytes >= 0)) i = (int) out_bytes;
1124
1128
  if (i) {
1125
1129
    if (lzx->wflag && (ret = mspack_write(lzx->ofd, lzx->o_ptr, i, lzx->file)) != CL_SUCCESS) {
1126
1130
      return lzx->error = ret;
1852
1856
 
1853
1857
  /* flush out any stored-up bytes before we begin */
1854
1858
  i = qtm->o_end - qtm->o_ptr;
1855
 
  if ((off_t) i > out_bytes) i = (int) out_bytes;
 
1859
  if (((off_t) i > out_bytes) && ((int) out_bytes >= 0)) i = (int) out_bytes;
1856
1860
  if (i) {
1857
1861
    if (qtm->wflag && (ret = mspack_write(qtm->ofd, qtm->o_ptr, i, qtm->file)) != CL_SUCCESS) {
1858
1862
      return qtm->error = ret;