Menu

#83 dkim_get_policy() has missing error checking

v2.3.2
closed-fixed
5
2007-11-30
2007-10-29
No

dkim_get_policy() doesn't check the return codes from dkim_get_policy_dns() and dkim_get_policy_file().

If an error is returned from one of those functions, it's possible that neither 'buf' nor 'qstat' have been changed. qstat is inited to NOERROR at the beginning of dkim_get_policy() which causes this block of code to exectued:

2030 if (qstat == NOERROR)
2031 {
2032 char *p;
2033 struct dkim_set *set;
2034
2035 pstatus = dkim_process_set(dkim, DKIM_SETTYPE_POLICY,
2036 buf, strlen(buf), NULL);

As mentioned above, 'buf' is uninitialized if there was an error in dkim_get_policy_dns(), etc..

Discussion

  • Anonymous

    Anonymous - 2007-10-29
    • assigned_to: nobody --> sm-msk
     
  • Anonymous

    Anonymous - 2007-10-29

    Logged In: YES
    user_id=1048957
    Originator: NO

    Try the attached patch.
    File Added: PATCH

     
  • Anonymous

    Anonymous - 2007-10-29

    Proposed patch #1

     
  • Anonymous

    Anonymous - 2007-11-30

    Logged In: YES
    user_id=1048957
    Originator: NO

    v2.4.0 released, containing this patch.

     
  • Anonymous

    Anonymous - 2007-11-30
    • status: open --> closed-fixed
     

Log in to post a comment.