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

A careless bug can crash JXcore when using PSK #668

Open
yaronyg opened this issue Mar 23, 2016 · 5 comments
Open

A careless bug can crash JXcore when using PSK #668

yaronyg opened this issue Mar 23, 2016 · 5 comments
Assignees
Labels

Comments

@yaronyg
Copy link
Member

@yaronyg yaronyg commented Mar 23, 2016

The Crash
Bad Code

I did a bad refactoring where the pskIdToSecret callback (which is eventually used as part of a psk Callback) had some unbounded variables inside of it (e.g. variables that weren't defined anywhere) and that caused JXcore to crash.

@cicorias
Copy link
Member

@cicorias cicorias commented Mar 23, 2016

Where are you calling tls.creatserver. Help if you have a line #

@yaronyg
Copy link
Member Author

@yaronyg yaronyg commented Mar 24, 2016

The function causing the crash is here. The problem was that I had screwed up a refactor and pskIdentity and pskKey were not bound to anything. in other words there was no declaration of either variable in any visible scope. Once I fixed that everything was fine. The createserver is called here

Another crash, I'm investigating now.

@yaronyg
Copy link
Member Author

@yaronyg yaronyg commented Mar 24, 2016

The new crash btw is in different code. I'll share the code once I figure out what is going on.

@yaronyg
Copy link
Member Author

@yaronyg yaronyg commented Mar 24, 2016

O.k. this crash was very similar to the first one. Another programming error from yours truly. IN this case the callback function was:

function (id) {
          return self.pskIdToSecret(id);
}

Where self.pskIdToSecret is undefined. That causes an immediate crash with full stack trace.

BTW, I don't consider this bug to be high priority. That's why it's in IceBox.

@cicorias
Copy link
Member

@cicorias cicorias commented Mar 24, 2016

Ok. I'll just poke around in other native areas and see how they validate undefined callbacks or undefined values

@yaronyg yaronyg added 1 - Backlog and removed 0 - Icebox labels Jul 14, 2016
@yaronyg yaronyg assigned enricogior and unassigned cicorias Jul 14, 2016
@yaronyg yaronyg added bug and removed 1 - Backlog labels Oct 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.