[S] Change in openvpn[master]: init: Fix conversion warnings
"razvanc \(Code Review\) via Openvpn-devel" <[email protected]>
| Newsgroups | gmane.network.openvpn.devel |
|---|---|
| Message-ID | <8624160d4895f30fb70169e65caad745eccebfa3-EmailReviewComments-HTML@gerrit.openvpn.net> |
Attention is currently required from: cron2, flichtenheld, plaisthos. razvanc has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1259?usp=email ) Change subject: init: Fix conversion warnings ...................................................................... Patch Set 19: (5 comments) Commit Message: http://gerrit.openvpn.net/c/openvpn/+/1259/comment/b634d84c_8d885174?usp=email : PS19, Line 10: - Return type of get_random is long, but we ensure that value In crypto.c the return value of `get_random()` is `int64_t` (not `long`). Am I missing something? File src/openvpn/init.c: http://gerrit.openvpn.net/c/openvpn/+/1259/comment/1b2e3467_cda3bcc1?usp=email : PS19, Line 479: const long j = get_random() % (i + 1); On systems where `int64_t` (which is what `get_random()` really returns) is larger than `long` (which is theoretically possible), this would be a narrowing conversion. http://gerrit.openvpn.net/c/openvpn/+/1259/comment/8709b5ec_0784e73f?usp=email : PS19, Line 2868: msg(M_WARN, "TUN MTU value (%zu) must be at least %u", mtu, TUN_MTU_MIN); Didn't `TUN_MTU_MIN` stay `int`? http://gerrit.openvpn.net/c/openvpn/+/1259/comment/5a083aa3_5ac86eec?usp=email : PS19, Line 2875: return (unsigned int)mtu; `frame_finalize_options()` calls `get_frame_mtu()` and puts the return value in a plain `int` (`frame->tun_mtu`). If the clamp above occurs, then I think that will make `frame->tun_mtu` `-1`. http://gerrit.openvpn.net/c/openvpn/+/1259/comment/d9a9b82d_20f14b0a?usp=email : PS19, Line 2905: payload_size = max_int(payload_size, o->ce.tls_mtu); Should this be `max_uint()` now? -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1259?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I41b9f7686180f2549bd4984cbbf66059f0ba2b15 Gerrit-Change-Number: 1259 Gerrit-PatchSet: 19 Gerrit-Owner: flichtenheld <[email protected]> Gerrit-Reviewer: cron2 <[email protected]> Gerrit-Reviewer: plaisthos <[email protected]> Gerrit-CC: openvpn-devel <[email protected]> Gerrit-CC: razvanc <[email protected]> Gerrit-Attention: plaisthos <[email protected]> Gerrit-Attention: cron2 <[email protected]> Gerrit-Attention: flichtenheld <[email protected]> Gerrit-Comment-Date: Wed, 26 Aug 2026 05:25:31 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel