Re: [PATCH] Fix missing argument handling in psql getopt

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Quentin Rameau <quinq(at)fifth(dot)space>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Fix missing argument handling in psql getopt
Date: 2019-08-25 15:02:32
Message-ID: 14042.1566745352@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Quentin Rameau <quinq(at)fifth(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2019-08-25 15:10:47 Re: pg_upgrade: Error out on too many command-line arguments
Previous Message Tom Lane 2019-08-25 14:29:59 Re: pg_upgrade: Error out on too many command-line arguments