>For this reason, force both strings to use IFNAMSIZ as size and, since
>this constant may not exist on every platform, ensure it is always

A problem with this patch misght be that strncpy() does NOT NUL terminates the
copied string.  (It writes EXACTLY IFNAMSIZ bytes but only when the string 
is shorter, it will writes NUL bytes in the reminder of the char array[].)

You could use strlcpy() but I'm not sure if that is available in Windows.

>     /* save result in output variables */
>     memcpy(best_gw, &res.gw, res.addr_size);
-    strcpy(best_iface, res.iface);
>+    strncpy(best_iface, res.iface, IFNAMSIZ);


Openvpn-devel mailing list

Reply via email to