From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7581 invoked from network); 6 Feb 2021 10:50:13 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 6 Feb 2021 10:50:13 -0000 Received: from mail-wr1-f43.google.com ([209.85.221.43]) by 1ess; Sat Feb 6 05:05:55 -0500 2021 Received: by mail-wr1-f43.google.com with SMTP id v15so10585910wrx.4 for <9front@9front.org>; Sat, 06 Feb 2021 02:05:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:to:cc:subject:date:in-reply-to:mime-version :content-transfer-encoding; bh=4Wr/IyywWUEWmz/Yp72GyDCeTRXNg/4w0oBnPyi3pa8=; b=H/DNBnsbeIcFkmset9EYXqtjmlCFDIqygBgm1iACnj2xobGg/ua7nCOFqp95xA6xoa CU3MdI5/MtHAQpPUDORh9bzO7RLG2LpGIiICxuCZCr5/WJM1LGaTNcWreFzZ46mchUs3 vcTsNMlBnXK3NkUCuSu4W+vv3NZUrgkCp0vIYwb+0A/YOx9ozInlyhROlu19gLvyR3+u X/Dc3n/iu4cCghEQ0gWBI84zrs3YHVZrtd6riPuXgGmwy5YECDgaMLS9bvC280MW58rL 0OyZEIJx6Kuy24s+jW3yBYQdiupj7vRD8F9GO48ojb2CPvW5oB1W75aZ7AFhANqfex32 3CDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:to:cc:subject:date:in-reply-to :mime-version:content-transfer-encoding; bh=4Wr/IyywWUEWmz/Yp72GyDCeTRXNg/4w0oBnPyi3pa8=; b=kiYwVwdZ7qsatv8at73jN+tIWz9xG//mKhvTUl5UOu05QpjHjVlsLenjNKdOrApaI5 AttKXV75P3uMVWUtAu9VqSot9twxtSKVqA5gZjY1U4TiIHNTTPEyljf62mEDWwttJSfS u7MLayPSeD3N0aeXcZVBEKc5qMTokTtudFdP3W4ZEkganEm4U5idmsretp2jt1CiapeA CJ8R4vyMmCnpMvBxJND0fLse8TsqQ9MhwyYIPK2OFNc1CrAmJExpdPc7e3/apHQrtcuq 7o1+g0xJdlE+GyMwTDi0MtxKp21sSGTHa4a7gLkVPV8S70Di4yOrluAlh+Rprv6Z/6oi d2zw== X-Gm-Message-State: AOAM533FOOXdT/IsKDL+xs/hWlVWQUTr68/e5v9s1Inh+qirybYeMqTy MobsGe78uRMKDAoCyriYTLM= X-Google-Smtp-Source: ABdhPJy11Kq7OxRzEGThV2aKMYaO625GtoMWIX+mHB19YLXrh1gtDUTzFbkylX5XEnLOX5MnAbKs0w== X-Received: by 2002:a5d:6b42:: with SMTP id x2mr9497869wrw.117.1612605945857; Sat, 06 Feb 2021 02:05:45 -0800 (PST) Return-Path: Received: from term.home ([185.64.155.70]) by smtp.gmail.com with ESMTPSA id e16sm15223613wrp.24.2021.02.06.02.05.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 06 Feb 2021 02:05:45 -0800 (PST) From: boehm.igor@gmail.com X-Google-Original-From: igor@gmail.com Message-ID: To: 9front@9front.org CC: boehm.igor@gmail.com Date: Sat, 06 Feb 2021 11:05:43 +0100 In-Reply-To: <7D1FE3106BC07BB1AC2EC2F04FC1D349@eigenstate.org> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: anonymous shared software high-performance dependency-oriented locator Subject: Re: [9front] drawterm: fix suicide caused by off-by-one write and out-of-bound read in libmemdraw/draw.c (patch) Reply-To: 9front@9front.org Precedence: bulk Quoth ori@eigenstate.org: > Quoth boehm.igor@gmail.com: > > for(i=0; i > - u = r[0] | (r[1]<<8) | (r[2]<<16) | (r[3]<<24); > > + for(j = 0, u = 0 ; j < 4 && r+j < end ; j++) > > + u |= r[j] << (8*j); > > > > This fix seems wrong: 'u = ...' is loading a pixel. Why > would we ever want to load *half* a pixel? > > it seems like we either want to stop early, or ensure we > allocate the right size image. Thanks for reviewing Ori. Yeah, you are right. Let me go back and study the code a bit more and try to come up with something that is not a hack.