pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Quentin Rameau <quinq@fifth.space>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [PATCH] Fix missing argument handling in psql getopt
Date: Sun, 25 Aug 2019 11:02:32 -0400
Message-ID: <14042.1566745352@sss.pgh.pa.us> (raw)
In-Reply-To: <20190825100617.GA6087@fifth.space>
References: <20190825100617.GA6087@fifth.space>

Quentin Rameau <quinq@fifth.space> writes:
> When passing an argument option with a missing argument, strcmp would
> be called with the argv terminating NULL.

Um ... so how would control get there with optind too large?
What test case/platform are you considering?

(There really shouldn't be *any* case where getopt advances
optind past argc, imo.)

			regards, tom lane





view thread (9+ messages)  latest in thread

Message-ID: <14042.1566745352@sss.pgh.pa.us>
Permalink:  ../14042.1566745352@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14042.1566745352@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, quinq@fifth.space
  Subject: Re: [PATCH] Fix missing argument handling in psql getopt
  In-Reply-To: <14042.1566745352@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox