{"thread":{"id":"4581","subject":"wrong check condition in patch-delta.c?","startedAt":"2006-06-20T06:32:21Z","lastAt":"2006-06-20T12:28:01Z","messageCount":3,"participants":["Nguyễn Thái Ngọc Duy","Marco Roeland","Nicolas Pitre"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"22111","messageId":"fcaeb9bf0606192332j5b2ee4b9ycf2c63c7b1820204@mail.gmail.com","threadId":"4581","inReplyTo":null,"subject":"wrong check condition in patch-delta.c?","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2006-06-20T06:32:21Z","receivedAt":"2006-06-20T06:32:21Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Hi,\nWhile inspecting patch-delta.c, I encounter this:\n                       if (cp_off + cp_size < cp_size ||\n                           cp_off + cp_size > src_size ||\n                           cp_size > size)\n                               goto bad;\n\"cp_off + cp_size < cp_size\" doesn't make sense to me. Is it on purpose?\n"},{"id":"22112","messageId":"20060620072150.GB26656@fiberbit.xs4all.nl","threadId":"4581","inReplyTo":"fcaeb9bf0606192332j5b2ee4b9ycf2c63c7b1820204@mail.gmail.com","subject":"Re: wrong check condition in patch-delta.c?","fromName":"Marco Roeland","fromEmail":"marco.roeland@xs4all.nl","sentAt":"2006-06-20T07:21:50Z","receivedAt":"2006-06-20T07:21:50Z","isPatch":false,"sender":{"key":"marco.roeland@xs4all.nl","avatar":null},"body":"On Tuesday June 20th 2006 Nguy???n Thái Ng???c Duy wrote:\n\n> While inspecting patch-delta.c, I encounter this:\n>                       if (cp_off + cp_size < cp_size ||\n>                           cp_off + cp_size > src_size ||\n>                           cp_size > size)\n>                               goto bad;\n> \"cp_off + cp_size < cp_size\" doesn't make sense to me. Is it on purpose?\n\nIt protects against possible overflow. Adding fixed length integers is\n\"wraparound\" after all and discards the \"carry\" bit.\n-- \nMarco Roeland\n"},{"id":"22135","messageId":"Pine.LNX.4.64.0606200827120.3377@localhost.localdomain","threadId":"4581","inReplyTo":"fcaeb9bf0606192332j5b2ee4b9ycf2c63c7b1820204@mail.gmail.com","subject":"Re: wrong check condition in patch-delta.c?","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-06-20T12:28:01Z","receivedAt":"2006-06-20T12:28:01Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Tue, 20 Jun 2006, Nguyn Thái Ngc Duy wrote:\n\n> Hi,\n> While inspecting patch-delta.c, I encounter this:\n>                       if (cp_off + cp_size < cp_size ||\n>                           cp_off + cp_size > src_size ||\n>                           cp_size > size)\n>                               goto bad;\n> \"cp_off + cp_size < cp_size\" doesn't make sense to me. Is it on purpose?\n\nYes, it absolutely is.\n\n\nNicolas\n"}]}