Navigation


Changeset 719:dc71992e3378 in freeDiameter


Ignore:
Timestamp:
Feb 21, 2011, 6:29:14 PM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Be less tolerant on DiameterURI format

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/ostr.c

    r717 r719  
    316316                       
    317317                        if (t >= (1<<16)) {
    318                                 TRACE_DEBUG(INFO, "Invalid DiameterURI: port value is too big, ignored.");
    319                                 p = 0;
    320                                 break;
     318                                TRACE_DEBUG(INFO, "Invalid DiameterURI: port value is too big.");
     319                                return EINVAL;
    321320                        }
    322321
     
    366365                }
    367366               
    368                 TRACE_DEBUG(INFO, "Invalid DiameterURI: transport string is not recognized ('%.*s'), ignored.", urisz - offset, uri + offset);
    369                
    370                 /* eat the remaining of invalid transport until a ';' */
    371                 for (; (offset < urisz) && ((char)uri[offset] != ';'); offset++);
     367                TRACE_DEBUG(INFO, "Invalid DiameterURI: transport string is not recognized ('%.*s').", urisz - offset, uri + offset);
     368                return EINVAL;
    372369        }
    373370after_transport:
     
    405402                }
    406403               
    407                 TRACE_DEBUG(INFO, "Invalid DiameterURI: protocol string is not recognized ('%.*s'), ignored.", urisz - offset, uri + offset);
    408                
    409                 /* eat the remaining of invalid transport until a ';' */
    410                 for (; (offset < urisz) && ((char)uri[offset] != ';'); offset++);
     404                TRACE_DEBUG(INFO, "Invalid DiameterURI: protocol string is not recognized ('%.*s').", urisz - offset, uri + offset);
     405                return EINVAL;
     406               
    411407        }
    412408after_proto:
     
    414410                return 0; /* Finished */
    415411       
    416         TRACE_DEBUG(INFO, "Invalid DiameterURI: string is not recognized ('%.*s'), ignored.", urisz - offset, uri + offset);
    417         return 0;
     412        TRACE_DEBUG(INFO, "Invalid DiameterURI: final part of string is not recognized ('%.*s').", urisz - offset, uri + offset);
     413        return EINVAL;
    418414}
    419415
Note: See TracChangeset for help on using the changeset viewer.