Hi,

I found this bug today, too. I found this bug report only after I had
created a patch. but I don't see a patch here so I'll post it anyway.

It fixes 3 bugs with the -z flag:

1. "z" is not passed to getopt_long so it's not accepted at all.
2. No "break" after setting "zflag" to true so an internal error is
reported.
3. attrs->zflag is left uninitialized (and therefore probably true) if
it's not set.

I hope that's all, but at least it seems to work for me again.


regards,
Sven
--- nc6-1.0/src/parser.c        2010-06-28 20:19:17.000000000 +0000
+++ parser.c    2010-06-28 20:18:48.000000000 +0000
@@ -165,7 +165,7 @@
        _verbosity_level = 0;
 
        /* option recognition loop */
-       while ((c = getopt_long(argc, argv, "46beT:hlnp:q:s:uvw:xXCt:",
+       while ((c = getopt_long(argc, argv, "46beT:hlnp:q:s:uvw:xXCt:z",
                                long_options, &option_index)) >= 0)
        {
                switch (c) {
@@ -322,6 +322,7 @@
                        exit(EXIT_FAILURE);
                case 'z':
                        zflag = true;
+                       break;
                default:        
                        fatal_internal(
                              "getopt returned unexpected character 0%o\n", c);
@@ -554,8 +555,7 @@
        if (rcvbuf_size > 0)
                ca_set_rcvbuf_size(attrs, rcvbuf_size);
 
-       if (zflag == true)
-               ca_set_zflag(attrs, zflag);
+       attrs->zflag = zflag;
 }
 
 

Reply via email to