> +int
> +main(int argc, char *argv[])
> +{
> +       int ch;
> +
> +       conf[CS_NTF_FG] = 0;
> +       conf[CS_NTF_LOG] = 0;
> +       conf[CS_NTF_STDOUT] = 0;
> +       conf[CS_NTF_SNMP] = 0;
> +       conf[CS_NTF_DBUS] = 0;
> +
> +       while ((ch = getopt (argc, argv, "floshdm:")) != EOF) {
> +               switch (ch) {
> +                       case 'f':
> +                               conf[CS_NTF_FG] = 1;
> +                               break;
> +                       case 'l':
> +                               conf[CS_NTF_LOG] = 1;
> +                               break;
> +                       case 'm':
> +                               conf[CS_NTF_SNMP] = 1;
> +                               strcpy(snmp_manager_buf, optarg);
> +                               snmp_manager = snmp_manager_buf;
> +                               break;

I would recommend using a length checking string copy such as
strncpy() here to avoid a possible buffer overflow from unexpected
input.

--
Russell Bryant
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to