[asterisk-bugs] [JIRA] (ASTERISK-21772) Code reading revealed useless if statement

Michael L. Young (JIRA) noreply at issues.asterisk.org
Thu May 9 09:54:38 CDT 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-21772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=206224#comment-206224 ] 

Michael L. Young edited comment on ASTERISK-21772 at 5/9/13 9:52 AM:
---------------------------------------------------------------------

Peter,

Thanks for your contribution.  Please read up on how to submit patches: https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines#AsteriskIssueGuidelines-PatchandCodesubmission

Once you sign a contributor's license, you can attach your patch just like Alec pointed out.
                
      was (Author: elguero):
    Peter,

Thanks for your contribution.  Please read up on ho to submit patches: https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines#AsteriskIssueGuidelines-PatchandCodesubmission

Once you sign a contributor's license, you can attach your patch just like Alec pointed out.
                  
> Code reading revealed useless if statement
> ------------------------------------------
>
>                 Key: ASTERISK-21772
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-21772
>             Project: Asterisk
>          Issue Type: Improvement
>      Security Level: None
>    Affects Versions: SVN
>            Reporter: Peter J. Philipp
>            Severity: Minor
>
> In code reading dns.c I see this:
>                 if (len < 0) {
>                         ast_log(LOG_WARNING, "Strange result size\n");
>                         return -1;
>                 }
>                 if (len < 0) {
>                         ast_log(LOG_WARNING, "Length exceeds frame\n");
>                         return -1;
>                 }
> 1. the second if will always be false if it's called
> 2. adds useless check, since first already covers it
> I don't see a patch upload field here so here goes the patch:
> [edit: removed inline patch]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list