[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] libxenstat/Linux: pass nul-terminated string to strpbrk()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 8 Aug 2023 10:53:43 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Tue, 08 Aug 2023 09:53:57 +0000
  • Ironport-data: A9a23:7+LMkKCIjQC0wxVW/xvjw5YqxClBgxIJ4kV8jS/XYbTApDgn0mBTy TEWWG2DOfaONmqgctFzOYy29ExU757XyNFmQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GNA4QRkDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw5tlbLlERz N4jcxtSY0GAq+m42b+fVbw57igjBJGD0II3v3hhyXfSDOo8QICFSKLPjTNa9G5u3IYUR6+YP pdHL2M1N3wsYDUWUrsTIJs4gOevgGi5azBCoUiZjaE2/3LS3Ep6172F3N/9I4XaHJwOxhbIz o7A12P5ITsrDuK+8we+40iCoOzxpSG8ZrtHQdVU8dY12QbOlwT/EiY+V1G2vP24gU6WQM9EJ gof/S9Ghbg/8gmnQ8fwWzW8oWWYpVgMVtxICeo45QqRjK3O7G6xGWwsXjNHLts8u6ceRzMw0 USSt8j0HjEpu7qQIVqU7rqOpCm+ETQUJ2QFIyQDSGM4D8LL+d9pyEiVF5A6TfDz14eucd3t/ 9yUhDQBq5oj0vcp7P6Qol2WgB6nqIHEahFgs207QVmZxg9+YYekYamh5l7a8etMIe6lc7WRg JQXs5PAtb5TVPlhgATIGbxQR+/xu55pJRWG2TZS848dGyNBEpJJVaRZ+3lAKUhgKa7okhe5M RaI6Wu9CHK+VUZGjJObgarrU6zGLoC6T7wJs8w4ifIQCqWdjCfdoElTibe4hggBanQEn6AlI ou8es2xF3scAqkP5GPoFr5BiuRxl3xunDO7qXXHI/OPi+P2WZJoYe1dbAvmgh4Rs8toXzk5A /4AbpDXmn2zocX1YzXN8J57ELz5BSFTOHwCkOQOLrTrClM/SAkc5wr5netJl3pNw/4EyY8lP xiVBidl9bYIrSeacFTaMC49NOuHsFQWhStTABHA9G2AgxALCbtDJo9GH3frVdHLLNBe8MM=
  • Ironport-hdrordr: A9a23:xOjV762D7xpA2xSkHZpCkAqjBEQkLtp133Aq2lEZdPU0SKGlfg 6V/MjztCWE7gr5PUtLpTnuAsa9qB/nm6KdpLNhX4tKPzOW31dATrsSjrcKqgeIc0HDH6xmpM JdmsBFY+EYZmIK6foSjjPYLz4hquP3j5xBh43lvglQpdcBUdAQ0+97YDzrYnGfXGN9dOME/A L33Ls7m9KnE05nFviTNz0+cMXogcbEr57iaQ5uPW9a1OHf5QnYk4ITCnKjr20jbw8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Jul 26, 2023 at 12:42:00PM +0200, Jan Beulich wrote:
> While what "tmp" points to has been cleared at the end of the first
> iteration of parseNetDevLine()'s main loop, this is too late for the
> first iteration's invocation of strpbrk() (copying the interface name).
> Properly nul-terminate the string at population time instead, removing
> the late clearing.
> 
> While there also eliminate a confusing (because of being wrong) comment:
> A regex parsing error would be handled one further scope outwards. Here
> we're dealing with field 1 vs any of the later fields.

I think the author of the comment meant that they couldn't create a
regex that locate the interface name, and instead used strpbrk(). But if
the comment is confusing, it's not helpful.

> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Thanks,

-- 
Anthony PERARD



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.