Skip to content

Commit

Permalink
Merge pull request #741 from mpatrascoiu/XrdHttpGridmapFix
Browse files Browse the repository at this point in the history
XrdHttp: Prevent segmentation fault when using http.gridmap
  • Loading branch information
ffurano committed Jun 13, 2018
2 parents 0f1c657 + f39b320 commit 53038e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/XrdHttp/XrdHttpProtocol.cc
Expand Up @@ -355,7 +355,7 @@ int XrdHttpProtocol::GetVOMSData(XrdLink *lp) {
// To set the name we pick the first CN of the certificate subject
// and hope that it makes some sense, it usually does
char *lnpos = strstr(SecEntity.moninfo, "/CN=");
char bufname[64], bufname2[9];
char bufname[256], bufname2[9];

if (lnpos) {
lnpos += 4;
Expand Down Expand Up @@ -384,7 +384,7 @@ int XrdHttpProtocol::GetVOMSData(XrdLink *lp) {
}

if (servGMap) {
int e = servGMap->dn2user(SecEntity.moninfo, bufname, 127, 0);
int e = servGMap->dn2user(SecEntity.moninfo, bufname, sizeof(bufname), 0);
if ( !e ) {
TRACEI(DEBUG, " Mapping Username: " << SecEntity.moninfo << " --> " << bufname);
if (SecEntity.name) free(SecEntity.name);
Expand Down

0 comments on commit 53038e1

Please sign in to comment.