You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2018/09/19 17:48:45 UTC

[Bug 7633] New: spamc free on opt likely not good

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7633

            Bug ID: 7633
           Summary: spamc free on opt likely not good
           Product: Spamassassin
           Version: 3.4.2
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: spamc/spamd
          Assignee: dev@spamassassin.apache.org
          Reporter: kmcgrail@apache.org
  Target Milestone: Undefined

Reported by Ondřej Lysoněk olysonek@redhat.com

the following patch fixes a potential use after free in getopt.c,
recently introduced by mistake it seems. 'opt' is assigned to
'spamc_optarg' so that it can be used later, so it can't possibly
be freed here.

This applies both to trunk and 3.4.

Index: spamc/getopt.c
===================================================================
--- spamc/getopt.c      (revision 1841353)
+++ spamc/getopt.c      (working copy)
@@ -274,7 +274,6 @@
             } else if(longopts[i].has_arg == optional_argument) {
                if(((spamc_optind < argc) && (argv[spamc_optind]) &&
(argv[spamc_optind][0] != '-')) ||
                      (opt != NULL)) {
-                 free(opt);
                   if(opt != NULL) {
                      spamc_optarg = opt;
                   } else {
===================================================================

Kind regards

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7633] spamc free on opt likely not good

Posted by bu...@bugzilla.spamassassin.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7633

Giovanni Bechis <gi...@paclan.it> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |giovanni@paclan.it

--- Comment #1 from Giovanni Bechis <gi...@paclan.it> ---
Fixed in r1841433,  thanks for reporting it.

-- 
You are receiving this mail because:
You are the assignee for the bug.