null iv parameter passed to combo_init() - Mailing list pgsql-hackers

From Zhihong Yu
Subject null iv parameter passed to combo_init()
Date
Msg-id CALNJ-vSBb2Ees=KB0frYBh7foK-QNZMbK7Vz66bUJa09D+CHAw@mail.gmail.com
Whole thread Raw
Responses Re: null iv parameter passed to combo_init()
List pgsql-hackers
Hi,
In contrib/pgcrypto/pgcrypto.c :

    err = px_combo_init(c, (uint8 *) VARDATA_ANY(key), klen, NULL, 0);

Note: NULL is passed as iv.

When combo_init() is called,

        if (ivlen > ivs)
            memcpy(ivbuf, iv, ivs);
        else
            memcpy(ivbuf, iv, ivlen);

It seems we need to consider the case of null being passed as iv for memcpy() because of this:

/usr/include/string.h:44:28: note: nonnull attribute specified here

What do you think of the following patch ?

Cheers
Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgsql: Refactor tar method of walmethods.c to rely on the compression m
Next
From: Jacob Champion
Date:
Subject: Re: [PoC] Delegating pg_ident to a third party