Re: PATCH: Fix wrong size argument to pg_strncasecmp - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PATCH: Fix wrong size argument to pg_strncasecmp
Date
Msg-id 23800.1580509696@sss.pgh.pa.us
Whole thread Raw
In response to PATCH: Fix wrong size argument to pg_strncasecmp  (Dominik Czarnota <dominik.b.czarnota@gmail.com>)
List pgsql-hackers
Dominik Czarnota <dominik.b.czarnota@gmail.com> writes:
> This patch fixes a size parameter of `pg_strncasecmp` which compared a
> "string" literal with a variable by passing a size of 5 while the "string"
> literal has 6 bytes.

Pushed, thanks for the report!

> By the way, the `strncasecmp` usages around the fixed line could use
> `strcasecmp` which doesn't accept the `size_t n` argument.

Maybe.  It's not clear to me that it's be okay to assume that the
variable input string is null-terminated.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: widen vacuum buffer counters
Next
From: Cleysson Lima
Date:
Subject: Re: Created feature for to_date() conversion using patterns'YYYY-WW', 'YYYY-WW-D', 'YYYY-MM-W' and 'YYYY-MM-W-D'