58 if( arg.size() > 255 )
72 return (sz > 0 && nelem < UINT_MAX / sz);
94 if (path.size() > 255)
98 const BESRegex name(
"[[:alpha:][:digit:]_./-]+");
99 return name.
match(path) ==
static_cast<int>(path.size());
103 return name.
match(path) ==
static_cast<int>(path.size());
107 BESRegex name(
"[[:alpha:][:digit:]_./-]+");
111 string::size_type len = path.size() ;
112 int ret = name.
match( path.c_str(), len ) ;
113 if( ret !=
static_cast<int>(len) )
Regular expression matching.
int match(const char *s, int len, int pos=0) const
Does the pattern match.
static bool size_ok(unsigned int sz, unsigned int nelem)
sanitize the size of an array. Test for integer overflow when dynamically allocating an array.
static bool pathname_ok(const std::string &path, bool strict)
Does the string name a potentailly valid pathname? Test the given pathname to verfiy that it is a val...
static bool command_line_arg_ok(const std::string &arg)
sanitize command line arguments