Hi Dhathri,

Please Add "Fixes" header to commit message.
Acked-by: Ankur Sharma <[email protected]>

Regards,
Ankur
________________________________
From: dev <[email protected]> on behalf of 
[email protected] <[email protected]>
Sent: Tuesday, June 30, 2020 10:04 AM
To: [email protected] <[email protected]>
Cc: Dhathri Purohith <[email protected]>
Subject: [ovs-dev] [PATCH v1 ovn] Fix seg fault while encoding DHCP domain 
search option.

From: Dhathri Purohith <[email protected]>

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 <[email protected]>
---
 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
[email protected]
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
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to