AcornSSL: mbedtls_net_bind() errors
Dave Higton (1515) 3534 posts |
net_sockets is a RISC OS specific file added to mbedtls. I’ve discovered two problems: 1) mbedtls_net_bind() calls Resolver_GetHost, which return -1 if it can’t resolve the given host. But this leads to an infinite loop within mbedtls_net_bind() because the failure code is not handled. 2) Calling mbedtls_net_bind() with address “INADDR_ANY” currently causes that infinite loop. It’s possible to bind to INADDRANY by providing a null pointer instead of a pointer to an address, but it isn’t nice – as the address is passed as a string to be resolved, you’d expect INADDR_ANY to be handled the same way. Currently every client has to detect “INADDR_ANY” and substitute null. There is another detail to watch out for – there’s a loop that terminates when it finds address 0, it’s used as an end of list marker. But INADDR_ANY is a valid address to bind to. |