Changes in src/gnutls_io.c [55dc3f0:fd82e59] in mod_gnutls


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_io.c

    r55dc3f0 rfd82e59  
    510510    if (ctxt->input_mode == AP_MODE_READBYTES ||
    511511            ctxt->input_mode == AP_MODE_SPECULATIVE) {
     512        if (readbytes < 0) {
     513            /* you're asking us to speculatively read a negative number of bytes! */
     514            return APR_ENOTIMPL;
     515        }
    512516        /* Err. This is bad. readbytes *can* be a 64bit int! len.. is NOT */
    513         if (readbytes < len) {
     517        if ((apr_size_t) readbytes < len) {
    514518            len = (apr_size_t) readbytes;
    515519        }
     
    573577
    574578apr_status_t mgs_filter_output(ap_filter_t * f, apr_bucket_brigade * bb) {
    575     apr_size_t ret;
     579    int ret;
    576580    mgs_handle_t *ctxt = (mgs_handle_t *) f->ctx;
    577581    apr_status_t status = APR_SUCCESS;
     
    672676                        return ctxt->output_rc;
    673677                    }
    674                 } else if (ret != len) {
     678                } else if ((apr_size_t)(ret) != len) {
     679                    /* we know the above cast is OK because len > 0 and ret >= 0 */
    675680                    /* Not able to send the entire bucket,
    676681                       split it and send it again. */
Note: See TracChangeset for help on using the changeset viewer.