Skip to content

Commit

Permalink
[XrdOuc] Fix potential null pointer dereference in copyCGI
Browse files Browse the repository at this point in the history
  • Loading branch information
amadio committed Nov 26, 2024
1 parent 74bb634 commit 02f5083
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/XrdOuc/XrdOucTPC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,15 @@ int XrdOucTPC::copyCGI(const char *cgi, char *Buff, int Blen)
int xlen;
bool eqs;

if (!cgi) {*Buff = 0; return 0;}

// Skip over initial ampersands
//
while(*cgi == '&' && *cgi) cgi++;

// Check if there is anything here
//
if (!cgi || *cgi == 0) {*Buff = 0; return 0;}
if (!*cgi) {*Buff = 0; return 0;}
Blen--;

// Copy all keys except system oriented ones.
Expand Down

0 comments on commit 02f5083

Please sign in to comment.