Commit 3b8f76aa authored by Nick Mathewson's avatar Nick Mathewson 🦀
Browse files

r17611@catbus: nickm | 2008-01-14 13:44:16 -0500

 add some missing checks for failing return values.


svn:r13130
parent e49229ca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ Changes in version 0.2.0.16-alpha - 2008-01-??
      to check our fallback consensus.  Fixes bug 583.
    - Make bridges round geoip info up, not down.
    - Avoid a spurious free on base64 failure.  Bugfix on 0.1.2.
    - Detect more kinds of possible internal error.

  o Minor features (controller):
    - Get NS events working again.  (Patch from tup)
+1 −1
Original line number Diff line number Diff line
@@ -2617,7 +2617,7 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg)
      }
      if (strlen(line->value) >= ISO_TIME_LEN+ISO_TIME_LEN+1) {
        /* ignore failure */
        parse_iso_time(line->value+ISO_TIME_LEN+1, &last_try);
        (void) parse_iso_time(line->value+ISO_TIME_LEN+1, &last_try);
      }
      if (!strcasecmp(line->key, "EntryGuardDownSince")) {
        node->unreachable_since = when;
+6 −2
Original line number Diff line number Diff line
@@ -835,8 +835,12 @@ add_default_trusted_dir_authorities(authority_type_t type)
      "88.198.7.215:80 6833 3D07 61BC F397 A587 A0C0 B963 E4A9 E99E C4D3",
    NULL
  };
  for (i=0; dirservers[i]; i++)
    parse_dir_server_line(dirservers[i], type, 0);
  for (i=0; dirservers[i]; i++) {
    if (parse_dir_server_line(dirservers[i], type, 0)<0) {
      log_err(LD_BUG, "Couldn't parse internal dirserver line %s",
              dirservers[i]);
    }
  }
}

/** Look at all the config options for using alternate directory
+3 −3
Original line number Diff line number Diff line
@@ -1500,8 +1500,8 @@ getinfo_helper_dir(control_connection_t *control_conn,
    question += strlen("extra-info/digest/");
    if (strlen(question) == HEX_DIGEST_LEN) {
      char d[DIGEST_LEN];
      signed_descriptor_t *sd;
      base16_decode(d, sizeof(d), question, strlen(question));
      signed_descriptor_t *sd = NULL;
      if (base16_decode(d, sizeof(d), question, strlen(question))==0)
        sd = extrainfo_get_by_descriptor_digest(d);
      if (sd) {
        const char *body = signed_descriptor_get_body(sd);
+14 −3
Original line number Diff line number Diff line
@@ -2959,7 +2959,11 @@ dir_networkstatus_download_failed(smartlist_t *failed, int status_code)
  {
    char digest[DIGEST_LEN];
    trusted_dir_server_t *dir;
    base16_decode(digest, DIGEST_LEN, fp, strlen(fp));
    if (base16_decode(digest, DIGEST_LEN, fp, strlen(fp))<0) {
      log_warn(LD_BUG, "Called with bad fingerprint in list: %s",
               escaped(fp));
      continue;
    }
    dir = router_get_trusteddirserver_by_digest(digest);

    if (dir)
@@ -3070,7 +3074,11 @@ dir_routerdesc_download_failed(smartlist_t *failed, int status_code,
      tor_assert(!was_extrainfo); /* not supported yet */
      SMARTLIST_FOREACH(failed, const char *, cp,
      {
        base16_decode(digest, DIGEST_LEN, cp, strlen(cp));
        if (base16_decode(digest, DIGEST_LEN, cp, strlen(cp))<0) {
          log_warn(LD_BUG, "Malformed fingerprint in list: %s",
                   escaped(cp));
          continue;
        }
        retry_bridge_descriptor_fetch_directly(digest);
      });
    }
@@ -3079,7 +3087,10 @@ dir_routerdesc_download_failed(smartlist_t *failed, int status_code,
  SMARTLIST_FOREACH(failed, const char *, cp,
  {
    download_status_t *dls = NULL;
    base16_decode(digest, DIGEST_LEN, cp, strlen(cp));
    if (base16_decode(digest, DIGEST_LEN, cp, strlen(cp)) < 0) {
      log_warn(LD_BUG, "Malformed fingerprint in list: %s", escaped(cp));
      continue;
    }
    if (was_extrainfo) {
      signed_descriptor_t *sd =
        router_get_by_extrainfo_digest(digest);
Loading