aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/Configuration.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/rfb/Configuration.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/rfb/Configuration.h')
-rw-r--r--common/rfb/Configuration.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/common/rfb/Configuration.h b/common/rfb/Configuration.h
index 6197317b..e23e8a51 100644
--- a/common/rfb/Configuration.h
+++ b/common/rfb/Configuration.h
@@ -256,24 +256,25 @@ namespace rfb {
class BinaryParameter : public VoidParameter {
public:
- BinaryParameter(const char* name_, const char* desc_, const void* v, int l,
- ConfigurationObject co=ConfGlobal);
+ BinaryParameter(const char* name_, const char* desc_,
+ const void* v, size_t l,
+ ConfigurationObject co=ConfGlobal);
using VoidParameter::setParam;
virtual ~BinaryParameter();
virtual bool setParam(const char* value);
- virtual void setParam(const void* v, int l);
+ virtual void setParam(const void* v, size_t l);
virtual char* getDefaultStr() const;
virtual char* getValueStr() const;
// getData() will return length zero if there is no data
// NB: data may be set to zero, OR set to a zero-length buffer
- void getData(void** data, int* length) const;
+ void getData(void** data, size_t* length) const;
protected:
char* value;
- int length;
+ size_t length;
char* def_value;
- int def_length;
+ size_t def_length;
};
// -=- ParameterIterator