From: "d12fk (Code Review)" Date: Thu, 12 Dec 2024 07:51:19 +0000 In-Reply-To: References: Reply-To: heiko@...515..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <66c96102e89c72569e02411d17be98fe4d25f509-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="yGCe11oVSsI="; charset=UTF-8 Subject: [Openvpn-devel] [L] Change in openvpn[master]: dns: support multiple domains without DHCP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stipa , plaisthos , flichtenheld , openvpn-devel --yGCe11oVSsI= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos, stipa. d12fk has posted comments on this change. ( http://gerrit.openvpn.net/c/ope= nvpn/+/824?usp=3Demail ) Change subject: dns: support multiple domains without DHCP ...................................................................... Patch Set 3: (3 comments) File src/openvpnserv/interactive.c: http://gerrit.openvpn.net/c/openvpn/+/824/comment/df2d8e6a_fc1974ba : PS2, Line 1302: CloseServiceHandle(dnssvc); > SAL: [=E2=80=A6] Done http://gerrit.openvpn.net/c/openvpn/+/824/comment/848dd16c_3cd12015 : PS2, Line 1584: size =3D (wcslen(list) + 1) * sizeof(list[0]); > I got a SAL warning: [=E2=80=A6] The actual check is in line 1572 where we make sure there is enough room in= the buffer to append the domains including the NUL at the end (+2, one for= the comma, the other one for \0) wcsncpy() pads the source string wit 0 if count is greater than the len of = the source string, so domlen + 1 will do the trick. I think it is indeed a false positive and wonder what triggers it. Let's tr= y to init list with zeros and if that defeats the diagnostic, good enough, = but it is not necessary. http://gerrit.openvpn.net/c/openvpn/+/824/comment/ffa63cf0_730a2c02 : PS2, Line 1648: RemoveDnsSearchDomains(HKEY key, PCWSTR domains) > SAL warning: [=E2=80=A6] Yeah, let's go with 2k and see where we land. Usually this should not be an= issue I think as there are normally not so many search domains set. There = _is_ no correct value here, unless you re(allocate) from the heap to make s= ure the local maximum is handled. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/824?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: Icaffbfa6b2e8efa2bd24a05537cb74b15f4fed96 Gerrit-Change-Number: 824 Gerrit-PatchSet: 3 Gerrit-Owner: d12fk Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-CC: stipa Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Attention: stipa Gerrit-Comment-Date: Thu, 12 Dec 2024 07:51:19 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: stipa Gerrit-MessageType: comment --yGCe11oVSsI= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos, stipa. <= /p>

View C= hange

3 comments:

    =
  • File src/openvpnserv/interactive.c:=

    • Patch Set #2, Line= 1302: CloseService= Handle(dnssvc);

      SAL: [=E2=80=A6]

      Done

    • Patch Set #2, Line 1584: size =3D (wcslen(list) + 1) * sizeof(list[0]);

      I got a SAL warning: [=E2=80=A6]

      The actual check is in line 1572 where = we make sure there is enough room in the buffer to append the domains inclu= ding the NUL at the end (+2, one for the comma, the other one for \0)

      wcsncpy() pads the= source string wit 0 if count is greater than the len of the source string,= so domlen + 1 will do the trick.

      I think it is indeed a false positive and wonder what = triggers it. Let's try to init list with zeros and if that defeats the = diagnostic, good enough, but it is not necessary.

    • Patch Se= t #2, Line 1648: Remove= DnsSearchDomains(HKEY key, PCWSTR domains)

      SAL warn= ing: [=E2=80=A6]

      Yeah, let's go with 2k and see where we land. Usually = this should not be an issue I think as there are normally not so many searc= h domains set. There _is_ no correct value here, unless you re(allocate) fr= om the heap to make sure the local maximum is handled.

  • To view, visit change 824. To unsubscribe, or for help writing mail filter= s, visit settings.

    Gerrit-Project: openvpn
    Gerrit-Branch: master
    Gerrit-Change-Id: Icaffbfa6b2e8efa2bd24a05537c= b74b15f4fed96
    Gerrit-Change-Number: 824
    Gerrit-PatchSet: 3
    Gerrit-Owner: d12fk <heiko@...515...>
    Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
    Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
    Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
    Gerrit-CC: stipa <lstipakov@...277...> <= /div>
    Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
    Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
    Gerrit-Attention: stipa <lstipakov@...1663...= .>
    Gerrit-Comment-Date: Thu, 12 Dec 2024 07:51:19= +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: stipa <lstipakov@...1664...= 7...>
    Gerrit-MessageType: comment
    --yGCe11oVSsI=--