From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by sourceware.org (Postfix) with ESMTPS id 4604A3855002 for ; Thu, 17 Jun 2021 18:37:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4604A3855002 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rtems.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f182.google.com with SMTP id g13so36503ljj.10 for ; Thu, 17 Jun 2021 11:37:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=4pljzLvYtpdbOKynFFnS9+AQSiw3L+BPIv7dW/IaNtU=; b=ZJiGE/e1Zjs97GgLh8DKUN3bGiTg/GZ/AioF6GVhOSMjpVvU5mVuMm01V7qxbKIFLp qXgUnwblGakcSKf7A5bJZnNz4plWOKDLCJeX/3wr3xweRzUihF9CmbWqvJVNJnvEDjdw 5HCtipKGJXuJWn0Qiq3v/2ksZIvc1jT3CVfiETS+ixGaNzyY43zVTIqC/o3hzx24tntb h+RLlF6j1lL6BZ6EPB9oH8f+Y8J1jC//u+myCEl1s0T1MU9H0UvQT06mixCFrMVal9RU 8ZM4eU1u0fTw6fk9DfjsSXGsHQmnZjWMXJhM6Rgb/hFZyRa80EzRB3v8fxgSS/HDuTjW yDAg== X-Gm-Message-State: AOAM530iJVredQeEXqF5ZHley7TScuIbuNGzNnwpJpI3KX7mxixmyx+Z IdnFteXZiNneUS5ZAfPH55zURLE/Jum3Cw== X-Google-Smtp-Source: ABdhPJwpLMv/mTirQST9HATKyXiSnFhHy4fWh0L8Rdqe7ZrRi9t6orUROqeLUBKsiQgF4VQhJTXoSg== X-Received: by 2002:a2e:9cd2:: with SMTP id g18mr5947168ljj.280.1623955031837; Thu, 17 Jun 2021 11:37:11 -0700 (PDT) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com. [209.85.208.179]) by smtp.gmail.com with ESMTPSA id d18sm653019lfe.86.2021.06.17.11.37.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Jun 2021 11:37:10 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id z22so10361607ljh.8 for ; Thu, 17 Jun 2021 11:37:10 -0700 (PDT) X-Received: by 2002:a2e:6819:: with SMTP id c25mr6016100lja.140.1623955030701; Thu, 17 Jun 2021 11:37:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: joel@rtems.org From: Joel Sherrill Date: Thu, 17 Jun 2021 13:36:59 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Fw: makedoc.c: Coverity Scan Issues To: C Howland Cc: Newlib X-Spam-Status: No, score=-3031.8 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2021 18:37:15 -0000 On Thu, Jun 17, 2021 at 1:30 PM C Howland wrote: > > > > ------------------------------ > > *From:* Newlib on > > behalf of Joel Sherrill > > *Sent:* Thursday, June 17, 2021 2:06 PM > > *To:* Newlib > > *Subject:* makedoc.c: Coverity Scan Issues > > > > > > Hi > > > > Scan reports 3 issues in makedoc.c. > > > > One is a memory leak around lines 1202 to 1282 because the variable > word > > holds memory allocated inside nextword. The method returns without > freeing > > the memory. I think adding a free() is sufficient for this. > > > > The others are from calling realloc() and not checking for NULL around > line > > 137. Is checking for the NULL, printing a message, and exit(1), an OK > thing > > to do here? > > > > Yes, that sounds good. (Seems very unlikely it would ever happen, > anyway.) > I agree since this is one of the few host based utilities in newlib. But it seemed better to address it. I'll try to post patches shortly. FWIW there are 61 defects being reported right now for newlib. I'm building for sparc-rtems6 as we use leon3 as our reference BSP for RTEMS coverity. It checks a few times a day if the RTEMS newlib git mirror has been updated and then kicks off an analysis. Happy to share the issues if anyone cares. --joel > Craig > > > Thanks. > > > > --joel > > > > > > >