Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkYLO-0003Dz-Rm for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Jul 2018 17:21:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fkYLM-0005O2-S9 for pgsql-hackers@arkaria.postgresql.org; Tue, 31 Jul 2018 17:21:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkYLM-0005Nj-D4 for pgsql-hackers@lists.postgresql.org; Tue, 31 Jul 2018 17:21:56 +0000 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fkYLI-00044u-Tw for pgsql-hackers@postgresql.org; Tue, 31 Jul 2018 17:21:55 +0000 Received: by mail-qk0-x244.google.com with SMTP id u21-v6so10772507qku.2 for ; Tue, 31 Jul 2018 10:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=LnRZaFNMmAOGib4MuQQlwRG2Qs3VwY/WO0gZBXLUi9I=; b=xihbyNo/gRIUoK1iHETJ67JNeEfzvMVVaud2BYDKWf6vauvpK5hVY+ZUqhqc/NTL2c PogOw6kiWX0j/gqXuV5Ci0CAr03c5g9unVfkoqmFrhgViH3j0uEqxgfH4uEVo4LY+FlY gsOaPmmBPAoqEEEncYyocvCzeyoCKMgE4wxyHn7LhErIbPkDX8R0/kqCNEi2oF4XsYZL PBy0h1mlHVk4pbth8qGTgvV12mRFzFN39JASI8C5dnehSDptDwYfIQ3zPanQ3wzfNeKH PU1OqQ44zxkYGsq/W07I0SYT7JzwRGqKpk9Qyh4+AsSA4DY/YD0cexyaX+RGlOTSajyA +agA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=LnRZaFNMmAOGib4MuQQlwRG2Qs3VwY/WO0gZBXLUi9I=; b=GfS3wUP2Q2Y4iBrgPILo8xBivcnZgct6/huN9VSg8y8eQQs0KdFl8X7c5U12C0VjjE iyARVOH7ZNKIG0DeGOfLT7dO/umjb2p6VDaXxcT1PCFKCipIaEYerdyQBBfIKsUU+OFr e9aId2ZXAFJDBihBa2JE3ED4Thx406ajcBtgwGS5hZIi5knO4O7LSIN/kKZ70/LrBNc2 SFHjSIqbPhyr1KMMguJBkp3CS7S8la9/aTSxyh6BO5G2IA8Ly8Gyza7HWDvFz5qJ7rQ8 9n0PfyXMh6iI7lVd4O8RuBvZcfMOkC6/XzhrzFi1EOn3F9slqzH7vh+7tEM4Hu7x79wT 36fQ== X-Gm-Message-State: AOUpUlFiPuxt4pbe6KwjlMdi3r85IsayKMQullI+rWLlOas9iughX8jG pXeHUM9r6HdlieGgJgiRYmmqnw== X-Google-Smtp-Source: AAOMgpepHZNoefKkHhXKMGg6u9Odb5ieLbIToiUNbQ57htb7p3kKqhutVJD6QwpAAVoqRlGBTEc6gw== X-Received: by 2002:a37:c9da:: with SMTP id m87-v6mr20821521qkl.431.1533057711894; Tue, 31 Jul 2018 10:21:51 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id f64-v6sm13107559qkf.2.2018.07.31.10.21.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 31 Jul 2018 10:21:51 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 34E751916; Tue, 31 Jul 2018 13:21:49 -0400 (-04) Date: Tue, 31 Jul 2018 13:21:49 -0400 From: Alvaro Herrera To: Tomas Vondra , Emre Hasegeli Cc: Pg Hackers Subject: Re: New Defects reported by Coverity Scan for PostgreSQL Message-ID: <20180731172149.kdjl3xdjjtwxaj4s@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello guys. Coverity complained about this patch as below. What, if anything, should be done about it? One solution is to mark it as a false-positive in Coverity, of course. On 2018-Jul-29, scan-admin@coverity.com wrote: > ** CID 1438146: API usage errors (SWAPPED_ARGUMENTS) > > > ________________________________________________________________________________________________________ > *** CID 1438146: API usage errors (SWAPPED_ARGUMENTS) > /srv/coverity/git/pgsql-git/postgresql/src/backend/utils/adt/geo_ops.c: 2647 in close_lseg() > 2641 LSEG *l1 = PG_GETARG_LSEG_P(0); > 2642 LSEG *l2 = PG_GETARG_LSEG_P(1); > 2643 Point *result; > 2644 > 2645 result = (Point *) palloc(sizeof(Point)); > 2646 > >>> CID 1438146: API usage errors (SWAPPED_ARGUMENTS) > >>> The positions of arguments in the call to "lseg_closept_lseg" do not match the ordering of the parameters: > * "l2" is passed to "l1" > * "l1" is passed to "l2" > 2647 lseg_closept_lseg(result, l2, l1); > 2648 > 2649 PG_RETURN_POINT_P(result); > 2650 } > 2651 > 2652 -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services