h2o/picotls

no error handling of key_schedule_new failure

Opened this issue · 0 comments

sshock commented

key_schedule_new is called from two places, but neither one checks for NULL return value.

As a result, failure to create a hash alg results in a crash (seg fault) happening later on in an unrelated spot.

Can we add something like this after calling key_schedule_new in these two spots?

        if (tls->key_schedule == NULL) {
            ret = PTLS_ERROR_NO_MEMORY;
            goto Exit;
        }