aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr/ZlibInStream.h
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2019-09-23 11:00:17 +0200
committerPierre Ossman <ossman@cendio.se>2019-11-15 11:55:05 +0100
commit0943c006c7d900dfc0281639e992791d6c567438 (patch)
tree9393960c3d86df32f6186a6feeb4fecfec376699 /common/rdr/ZlibInStream.h
parent4ff58f0acaeb566b79ae12cf013b376eaaaab834 (diff)
downloadtigervnc-0943c006c7d900dfc0281639e992791d6c567438.tar.gz
tigervnc-0943c006c7d900dfc0281639e992791d6c567438.zip
Use size_t for lengths in stream objects
Provides safety against them accidentally becoming negative because of bugs in the calculations. Also does the same to CharArray and friends as they were strongly connection to the stream objects.
Diffstat (limited to 'common/rdr/ZlibInStream.h')
-rw-r--r--common/rdr/ZlibInStream.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/rdr/ZlibInStream.h b/common/rdr/ZlibInStream.h
index 86ba1ff1..08784b0f 100644
--- a/common/rdr/ZlibInStream.h
+++ b/common/rdr/ZlibInStream.h
@@ -34,12 +34,12 @@ namespace rdr {
public:
- ZlibInStream(int bufSize=0);
+ ZlibInStream(size_t bufSize=0);
virtual ~ZlibInStream();
- void setUnderlying(InStream* is, int bytesIn);
+ void setUnderlying(InStream* is, size_t bytesIn);
void flushUnderlying();
- int pos();
+ size_t pos();
void reset();
private:
@@ -47,14 +47,14 @@ namespace rdr {
void init();
void deinit();
- int overrun(int itemSize, int nItems, bool wait);
+ size_t overrun(size_t itemSize, size_t nItems, bool wait);
bool decompress(bool wait);
InStream* underlying;
- int bufSize;
- int offset;
+ size_t bufSize;
+ size_t offset;
z_stream_s* zs;
- int bytesIn;
+ size_t bytesIn;
U8* start;
};