Commit e7387f75 authored by Yang Tse's avatar Yang Tse
Browse files

Fix overflow detection, thanks to Patrick Monnerat detecting test

parent 582bad89
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1039,8 +1039,9 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
       *  Check that request length does not overflow the size_t type.
       */

      if ((data->set.postfieldsize < 0) ||
          (data->set.postfieldsize > (curl_off_t)((size_t)-1)))
      if ((sizeof(curl_off_t) != sizeof(size_t)) &&
          ((data->set.postfieldsize < 0) ||
           (data->set.postfieldsize > (curl_off_t)((size_t)-1))))
        result = CURLE_OUT_OF_MEMORY;
      else {
        char * p;