diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c index 28d0ee8..5471d39 100644 --- a/lib/gnutls_record.c +++ b/lib/gnutls_record.c @@ -868,9 +868,11 @@ gnutls_datum_t raw; /* raw headers */ if (ret < 0 && gnutls_error_is_fatal (ret) == 0) return ret; - if (ret >= 0) + if (ret > 0) ret = GNUTLS_E_UNEXPECTED_PACKET_LENGTH; - + else if (ret == 0) + ret = GNUTLS_E_PREMATURE_TERMINATION; + return gnutls_assert_val(ret); }