Discovered the problem while testing #1255 with multiple clients online
at the same time, with different capabilities - and it only sent anything
to the very first (capable) client, and then "empty string" because
the buffer in msgs[i] was buf_advance()'d and it shouldn't have been...

So this fixes things by doing a shallow copy to a temp "buffer", which
is safe as long as no writes to the memory is done - reading & advancing
the pointers is fine (we discussed various approaches on IRC, as can
be seen in v1/v3/v4 in gerrit ;-) - and a "make documentation for this
API" issue also appeared...).

Tested this + #1255, and now things behave correctly.

Your patch has been applied to the master branch.

commit 107f80b8e3102cca3a2cc008d37895f96ec2f17c
Author: Marco Baffo
Date:   Fri Oct 10 16:19:56 2025 +0200

     PUSH_UPDATE server: bug-fix, reset buffer after processing

     Signed-off-by: Marco Baffo <[email protected]>
     Acked-by: Gert Doering <[email protected]>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1264
     Message-Id: <[email protected]>
     URL: https://sourceforge.net/p/openvpn/mailman/message/59244933/
     Signed-off-by: Gert Doering <[email protected]>


--
kind regards,

Gert Doering



_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to