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

Add NULL check in originate-coa #1156

Merged
merged 1 commit into from Jul 22, 2015
Merged

Add NULL check in originate-coa #1156

merged 1 commit into from Jul 22, 2015

Conversation

qnet-herwin
Copy link
Contributor

This prevents segfaults that may occur when the COA list could not be created, either by a lack of memory, or a request that is not an Access-Request/Accounting-Request.

Easiest way to reproduce:

Create a CoA request from the coa virtual server

server coa {
  recv-coa {
    update coa {
      &NAS-IP-Address = '127.0.0.1'
    }
  }
}

Then, send some CoA packet to this server

echo 'User-Name = test' | radclient 127.0.0.1:3799 coa testing123

The segfault occurs because creating CoA packets is only supported for {Access,Accounting}-Request messages (which is also documented). It may also happen when there is a lack of memory and the talloc call fails, but that is harder to test.

This prevents segfaults that may occur when the COA list could not be created, either by a lack of memory, or a request that is not an Access-Request/Accounting-Request
@qnet-herwin
Copy link
Contributor Author

BTW, I haven't tested this with 3.1.x, but I wouldn't be surprised if the same problem occured there too.

alandekok added a commit that referenced this pull request Jul 22, 2015
@alandekok alandekok merged commit f72deb5 into FreeRADIUS:v3.0.x Jul 22, 2015
@qnet-herwin qnet-herwin deleted the originate_coa_from_wrong_requests branch July 23, 2015 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants