From: "cron2 (Code Review)" Date: Mon, 8 Jul 2024 19:27:55 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="RQbELwJ65lg="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Allow trailing \r and \n in control channel message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: flichtenheld , openvpn-devel --RQbELwJ65lg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/ope= nvpn/+/672?usp=3Demail ) Change subject: Allow trailing \r and \n in control channel message ...................................................................... Patch Set 2: Code-Review-1 (3 comments) Patchset: PS2: getting close File src/openvpn/forward.c: http://gerrit.openvpn.net/c/openvpn/+/672/comment/fbe5364d_eb37f3f4 : PS2, Line 302: int buflen =3D (int)strlen(BSTR(&buf)) + 1; While this is besser than the original, I find it still confusing to call `= strlen()` twice on the very same string, in direct sequence. What's wrong = with `int buflen =3D cmdlen +1;`...? http://gerrit.openvpn.net/c/openvpn/+/672/comment/46ed5072_d7aeafa2 : PS2, Line 318: format_hex(BPTR(&buf), BLEN(&cmdbuf)= , 256, &gc)); > While it is not actually wrong to use BPTR(&buf) here, I would recommend = BPTR(&cmdbuf). [=E2=80=A6] It is "not wrong today", but this sort of booby trap will come back and bit= e us later - so this should both be `&cmdbuf` if that's the buffer we have = looked at (especially with new code in the pipeline that might handle multi= ple commands in a single TLS record etc) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/672?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I47c992b6b73b1475cbff8a28f720cf50dc1fbe3e Gerrit-Change-Number: 672 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Comment-Date: Mon, 08 Jul 2024 19:27:55 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: flichtenheld Gerrit-MessageType: comment --RQbELwJ65lg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

Patch set 2:Code-Review -1=

Vi= ew Change

3 comments:

  • Patchset:

  • File src/openvpn/forward.c:

    • Patch Set #2, Line 302: int buflen =3D (int)st= rlen(BSTR(&buf)) + 1;

      While this is besser than the original, I find it still= confusing to call `strlen()` twice on the very same string, in direct sequ= ence. What's wrong with `int buflen =3D cmdlen +1;`...?

    • Patch Set #2, Line 318: format_hex(BPTR(&buf), BLEN(&cmdbuf), 2= 56, &gc));

      While it is not actually wrong to use = BPTR(&buf) here, I would recommend BPTR(&cmdbuf). [=E2=80=A6]

      It is= "not wrong today", but this sort of booby trap will come back an= d bite us later - so this should both be `&cmdbuf` if that's the bu= ffer we have looked at (especially with new code in the pipeline that might= handle multiple commands in a single TLS record etc)

  • To view, visit change 672. To unsubscribe, or for help writing mail filters= , visit settings.

    Gerrit-Project: openvpn
    Gerrit-Branch: master
    Gerrit-Change-Id: I47c992b6b73b1475cbff8a28f72= 0cf50dc1fbe3e
    Gerrit-Change-Number: 672
    Gerrit-PatchSet: 2
    Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
    Gerrit-Reviewer: cron2 <gert@...1296...>=
    Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
    Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
    Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
    Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
    Gerrit-Comment-Date: Mon, 08 Jul 2024 19:27:55= +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: flichtenheld <frank@...1186...= .2641...>
    Gerrit-MessageType: comment
    --RQbELwJ65lg=--