Fix seg fault with 0 p val in SKE
[openssl.git] / ssl / s3_pkt.c
index 603c285ac4994088f03f6c8a6082ebfc47bfdaa4..379890237e8663b72a68f38a6e472a1d019e4312 100644 (file)
@@ -1115,7 +1115,7 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf,
             s->rwstate = SSL_NOTHING;
             return (s->s3->wpend_ret);
         } else if (i <= 0) {
-            if (s->version == DTLS1_VERSION || s->version == DTLS1_BAD_VER) {
+            if (SSL_IS_DTLS(s)) {
                 /*
                  * For DTLS, just drop it. That's kind of the whole point in
                  * using a datagram service