-->
Page 2 of 2

Re: ESP8266 crashes in softAP mode

PostPosted: Fri Aug 02, 2019 7:59 pm
by davydnorris
quackmore wrote:I don't like os_memcpy(ap.password, "", 10)
but in case you are lucky it will end up with an empty password



It's not the result that's the problem - it's the operation. This will attempt to copy 10 bytes from a memory location pointing to '\0'. If the code is bounds checking arrays then you'll get exactly the error the OP mentioned.

I'm hoping they just deleted the plain text password as part of their post

Re: ESP8266 crashes in softAP mode

PostPosted: Fri Aug 02, 2019 10:33 pm
by quackmore
Don't think so

That's an empty string, not NULL

The '\0' will be copied at the beginning of the password, then 9 other "unknown" characters will follow

Re: ESP8266 crashes in softAP mode

PostPosted: Sat Aug 03, 2019 7:49 pm
by davydnorris
quackmore wrote:Don't think so

That's an empty string, not NULL

The '\0' will be copied at the beginning of the password, then 9 other "unknown" characters will follow


Correct - an empty string is the character '\0'.

The problem is that the code is asking to copy 10 bytes from a location that is only officially 1 byte long. Bounds checking in the copy routine will throw a LoadProhibitedCause 28 exception when you overrun the end of the source.

We really need to hear from the OP as to whether this code is what is written or if it was edited for the post

Re: ESP8266 crashes in softAP mode

PostPosted: Sat Aug 03, 2019 11:38 pm
by quackmore
Code: Select allThe problem is that the code is asking to copy 10 bytes from a location that is only officially 1 byte long.


Agreed
Totally see what you mean
Not sure about way it could lead to a memory violation but it could and it's definitely not good
That's why I said I didn't like it