Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfixes: initialize asg level to avoid randomized access rights and fix buffer overrun #52

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/gateAs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ gateAsEntry* gateAs::findEntryInList(const char* pv, gateAsList& list) const
int len = (int) strlen(pv);
#ifdef USE_PCRE
pi->substrings=pcre_exec(pi->pat_buff, NULL,
pv, len, 0, PCRE_ANCHORED, pi->ovector, 30);
pv, len, 0, PCRE_ANCHORED, pi->ovector, pi->ovecsize);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-and-paste bug I had introduced in or before 2007.

if((pi->substrings>=0 && pi->ovector[1] == len)
#ifdef USE_NEG_REGEXP
^ pi->negate_pattern
Expand All @@ -411,7 +411,6 @@ gateAsEntry* gateAs::findEntryInList(const char* pv, gateAsList& list) const

int gateAs::readPvList(const char* lfile)
{
int lev;
int line=0;
FILE* fd;
char inbuf[GATE_MAX_PVLIST_LINE_LENGTH];
Expand Down Expand Up @@ -448,7 +447,7 @@ int gateAs::readPvList(const char* lfile)

// Read all PV file lines
while(fgets(inbuf,sizeof(inbuf),fd)) {

int lev=1;

++line;
pattern=rname=hname=NULL;
Expand Down
Loading