On Wed, Jul 1, 2020 at 6:08 AM Ankur Sharma <ankur.sha...@nutanix.com> wrote:
> Hi Dhathri, > > Please Add "Fixes" header to commit message. > Acked-by: Ankur Sharma <ankur.sha...@nutanix.com> > Thanks. I applied this patch to master. Numan > > Regards, > Ankur > ________________________________ > From: dev <ovs-dev-boun...@openvswitch.org> on behalf of > svc.eng.git-pa...@nutanix.com <svc.eng.git-pa...@nutanix.com> > Sent: Tuesday, June 30, 2020 10:04 AM > To: ovs-dev@openvswitch.org <ovs-dev@openvswitch.org> > Cc: Dhathri Purohith <dhathri.puroh...@nutanix.com> > Subject: [ovs-dev] [PATCH v1 ovn] Fix seg fault while encoding DHCP domain > search option. > > From: Dhathri Purohith <dhathri.puroh...@nutanix.com> > > Some versions of strtok_r make the original string NULL at the > end of parsing. Adding Null check before ovs_strlcpy() to > prevent segfault in such cases. > > Fixes: d79bb92c4b49 ("Add support for DHCP domain search option (119)") > > Signed-off-by: Dhathri Purohith <dhathri.puroh...@nutanix.com> > --- > lib/actions.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/actions.c b/lib/actions.c > index ee7c825..c435188 100644 > --- a/lib/actions.c > +++ b/lib/actions.c > @@ -2382,7 +2382,9 @@ encode_put_dhcpv4_option(const struct > ovnact_gen_option *o, > memcpy(dns_encoded + encode_offset, label, len); > encode_offset += len; > } > - ovs_strlcpy(suffix, domain, strlen(domain)); > + if (domain != NULL) { > + ovs_strlcpy(suffix, domain, strlen(domain)); > + } > } > /* Add the end marker (0 byte) to determine the end of the > * domain. */ > -- > 1.8.3.1 > > _______________________________________________ > dev mailing list > d...@openvswitch.org > > https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=s883GpUCOChKOHiocYtGcg&r=mZwX9gFQgeJHzTg-68aCJgsODyUEVsHGFOfL90J6MJY&m=mrAPsNW3OUjyTaiBr9x2Wdad6HyRZlWB0aP_jabab2Q&s=BP9Lyas6JfOFnD5o4bicAfuqjSVXjXMSyUVHPki1Ijo&e= > _______________________________________________ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > > _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev