Changeset 644162a


Ignore:
Timestamp:
Nov 19, 2021, 11:58:29 AM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
3e417bf
Parents:
52d2545
Message:

Fix problem in splice use with signed/unsigned comparison.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/protocol.cfa

    r52d2545 r644162a  
    332332        wait(this.f);
    333333
    334         // Did something crazy happen?
    335         if(this.f.result > this.len) {
    336                 mutex(serr) serr | "SPLICE IN spliced too much!";
    337                 return error(this.res, -ERANGE);
    338         }
    339 
    340334        // Something failed?
    341335        if(this.f.result < 0) {
     
    351345                        return error(this.res, -ECONNRESET);
    352346                }
     347        }
     348
     349        // Did something crazy happen?
     350        if(this.f.result > this.len) {
     351                mutex(serr) serr | "SPLICE IN spliced too much!";
     352                return error(this.res, -ERANGE);
    353353        }
    354354
     
    401401        wait(this.f);
    402402
    403         // Did something crazy happen?
    404         if(this.f.result > this.len) {
    405                 mutex(serr) serr | "SPLICE OUT spliced too much!";
    406                 return error(this.res, -ERANGE);
    407         }
    408 
    409403        // Something failed?
    410404        if(this.f.result < 0) {
     
    420414                        return error(this, -ECONNRESET);
    421415                }
     416        }
     417
     418        // Did something crazy happen?
     419        if(this.f.result > this.len) {
     420                mutex(serr) serr | "SPLICE OUT spliced too much!" | this.f.result | ">" | this.len;
     421                return error(this.res, -ERANGE);
    422422        }
    423423
Note: See TracChangeset for help on using the changeset viewer.