Branch: Tag:

2000-02-15

2000-02-15 00:51:23 by Leif Stensson <leif@lysator.liu.se>

Added a sanity check in register_url() to avoid cryptic error
messages about "Bad argument 1 to sscanf()".

Rev: server/base_server/roxen.pike:1.428

5:    */      // ABS and suicide systems contributed freely by Francesco Chemolli - constant cvs_version="$Id: roxen.pike,v 1.427 2000/02/14 10:43:04 per Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.428 2000/02/15 00:51:23 leif Exp $";      object backend_thread;   ArgCache argcache;
1507:    url = replace( url, "/any", "/*" );       sscanf( url, "%[^:]://%[^/]%s", protocol, host, path ); -  sscanf( host, "%[^:]:%d", host, port ); +  if (!host || !stringp(host)) +  { +  report_error("Bad URL `" + url + "' for server `" + +  conf->query_name() + "'\n"); +  return 1; +  } +  sscanf(host, "%[^:]:%d", host, port);       if( strlen( path ) && ( path[-1] == '/' ) )    path = path[..strlen(path)-2];