Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

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

Comments

@yaronyg
Copy link
Member

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

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

@yaronyg
Copy link
Member Author

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 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 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

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

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants