Attention is currently required from: Arne Schwabe, Frank Lichtenheld.

Răzvan Cojocaru has posted comments on this change by Frank Lichtenheld. ( 
https://gerrit.openvpn.net/c/openvpn/+/1996?usp=email )

Change subject: Replace strncat with strlcat
......................................................................


Patch Set 1: Code-Review-1

(4 comments)

File src/openvpn/xkey_helper.c:

https://gerrit.openvpn.net/c/openvpn/+/1996/comment/72545cf8_7c8c9f5d?usp=email 
:
PS1, Line 253:         }
This function says it will return `-1` on error, so this is technically correct 
in that sense. However, it's callback type says `0` or `1`, which is confusing:

```
/**
 * Callback for sign operation -- must be implemented for each backend and
 * is used in xkey_signature_sign(), or set when loading the key.
 * (custom key loading not yet implemented).
 *
 * @param handle opaque key handle provided by the backend -- could be null
 *               or unused for management interface.
 * @param sig    On return caller should fill this with the signature
 * @param siglen On entry *siglen has max size of sig and on return must be
 *               set to the actual size of the signature
 * @param tbs    buffer to sign
 * @param tbslen size of data in tbs buffer
 * @sigalg       contains the signature algorithm parameters
 *
 * @returns 1 on success, 0 on error.
 *
 * If sigalg.op = "Sign", the data in tbs is the digest. If sigalg.op = 
"DigestSign"
 * it is the message that the backend should hash wih appropriate hash 
algorithm before
 * signing. In the former case no DigestInfo header is added to tbs. This is
 * unlike the deprecated RSA_sign callback which provides encoded digest.
 * For RSA_PKCS1 signatures, the external signing function must encode the 
digest
 * before signing. The digest algorithm used (or to be used) is passed in the 
sigalg
 * structure.
 */
typedef int(XKEY_EXTERNAL_SIGN_fn)(void *handle, unsigned char *sig, size_t 
*siglen,
                                   const unsigned char *tbs, size_t tbslen, 
XKEY_SIGALG sigalg);
```


File src/plugins/auth-pam/utils.c:

https://gerrit.openvpn.net/c/openvpn/+/1996/comment/2c765722_cab83dde?usp=email 
:
PS1, Line 75:     char temp[templen + 1] = { 0 };
This is a variable-length array, and C11 doesn't allow that, so GCC 16 rejects 
it:

```
error: variable-sized object may not be initialized except with an empty 
initializer

```


https://gerrit.openvpn.net/c/openvpn/+/1996/comment/29c88cdc_abdb959e?usp=email 
:
PS1, Line 83:         memcpy(target, replacewith, replacewithlen);
`target` isn't advanced after copying `replacewith`. I think we want `target += 
replacewithlen;` here.


https://gerrit.openvpn.net/c/openvpn/+/1996/comment/cfb1de43_43c90eb9?usp=email 
:
PS1, Line 85:         searching = scratch + tosearchlen;
Shouldn't we use the length of `searchfor` here?



--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/1996?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I61e29dd2af9302b240c93735179d43c72e37b335
Gerrit-Change-Number: 1996
Gerrit-PatchSet: 1
Gerrit-Owner: Frank Lichtenheld <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Răzvan Cojocaru <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Frank Lichtenheld <[email protected]>
Gerrit-Comment-Date: Wed, 14 Oct 2026 07:33:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to