Missing check on application error
@@ -3826,8 +3826,7 @@ const uint8_t* picoquic_decode_datagram_frame(picoquic_cnx_t* cnx, const uint8_t
length = bytes_max - bytes;
}
- if (bytes != NULL) {
- if (cnx->callback_fn != NULL) {
+ if (bytes != NULL && cnx->callback_fn != NULL) {
/* submit the data to the app */
if (cnx->callback_fn(cnx, 0, (uint8_t*)bytes, (size_t)length, picoquic_callback_datagram,
cnx->callback_ctx, NULL) != 0) {
@@ -3835,7 +3834,7 @@ const uint8_t* picoquic_decode_datagram_frame(picoquic_cnx_t* cnx, const uint8_t
bytes = NULL;
}
}
-
+ if (bytes != NULL){
bytes += length;
}
