Skip to content

Commit

Permalink
Merge pull request #1787 from Expensify/main
Browse files Browse the repository at this point in the history
Update expensify_prod branch
  • Loading branch information
smarthall committed Jun 26, 2024
2 parents ce35fb8 + f636d81 commit 5000e5f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libstuff/SRandom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ uint64_t SRandom::rand64() {
return _distribution64(_generator);
}

string SRandom::randStr(uint& length) {
string SRandom::randStr(uint length) {
string str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
string newstr;
int pos;
while(newstr.size() != length) {
while (newstr.size() != length) {
pos = (rand64() % (str.size() - 1));
newstr += str.substr(pos,1);
newstr += str.substr(pos, 1);
}
return newstr;
}
2 changes: 1 addition & 1 deletion libstuff/SRandom.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SRandom {
public:
static uint64_t rand64();
static uint64_t limitedRand64(uint64_t min, uint64_t max);
static string randStr(uint& length);
static string randStr(uint length);

private:
static mt19937_64 _generator;
Expand Down
4 changes: 2 additions & 2 deletions libstuff/libstuff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2806,11 +2806,11 @@ bool SIsValidSQLiteDateModifier(const string& modifier) {
}

bool SREMatch(const string& regExp, const string& s) {
return pcrecpp::RE(regExp).FullMatch(s);
return pcrecpp::RE(regExp, pcrecpp::RE_Options().set_match_limit_recursion(1000)).FullMatch(s);
}

bool SREMatch(const string& regExp, const string& s, string& match) {
return pcrecpp::RE(regExp).FullMatch(s, &match);
return pcrecpp::RE(regExp, pcrecpp::RE_Options().set_match_limit_recursion(1000)).FullMatch(s, &match);
}

void SRedactSensitiveValues(string& s) {
Expand Down

0 comments on commit 5000e5f

Please sign in to comment.