From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35607 invoked by alias); 17 May 2017 22:24:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 35315 invoked by uid 89); 17 May 2017 22:24:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-qt0-f173.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=+dGgAE6gAuBVQuKU2jS2MoZCn269t6qo6JdDzP0ufv0=; b=qNl8B4zHAsefq2ibftgBZHo6y8CnGJnsyGDiH6x1NhAoiONU2IwiPvZ/0kUIGGa/DL D2OOgylmxMsV0yOh+7vvkxCHYLKLkO9vcWC0MFlYn5CE/reV8XK8wJej58JDwakm1io3 G+DGfeXqkozv0yFYVOvZhdH0cgWoPHl7sHopgE7NDOp5w+FSVkMzgllp3MNTHIBQah7C xJbg7qZh34HfuNr/nCMwtsXHt3rO1mRmBnMw6abATTQHuvM2CvLOG9axv9Rnh0fi65vc q9u6xy5YKuZrW2neAkHM9tq3lkl+O18wwBAz0yUs1HS4NSiJQl7hw8AWPM37Dg4j6GqS O7Yg== X-Gm-Message-State: AODbwcAHcyoS/LtLW4DP1uWuXMCqKi2ku5sbJSpnrLEV78x2Odd6T1rR q8ADqtajysebw29+mb3z3seG4MXsWoh6 X-Received: by 10.237.63.239 with SMTP id w44mr751774qth.135.1495059857265; Wed, 17 May 2017 15:24:17 -0700 (PDT) MIME-Version: 1.0 From: "H.J. Lu" Date: Wed, 17 May 2017 22:24:00 -0000 Message-ID: Subject: Should memchr work with invalid data size? To: GNU C Library Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2017-05/txt/msg00523.txt.bz2 "main memchr" says The memchr() function scans the initial n bytes of the memory area pointed to by s for the first instance of c. But test-memchr.c has if (pos < len) { size_t r = random (); if ((r & 31) == 0) len = ~(uintptr_t) (p + align) - ((r >> 5) & 31); result = (CHAR *) (p + pos + align); } which sets len to some random value, like 18446603336355475958. Should memchr work with it? -- H.J.