소스 검색

Clean keys on stack in rend_service_intro_has_opened()

Andrea Shepard 12 년 전
부모
커밋
88c5d3ca55
1개의 변경된 파일11개의 추가작업 그리고 4개의 파일을 삭제
  1. 11 4
      src/or/rendservice.c

+ 11 - 4
src/or/rendservice.c

@@ -1627,8 +1627,8 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
          this case, we might as well close the thing. */
       log_info(LD_CIRC|LD_REND, "We have just finished an introduction "
                "circuit, but we already have enough.  Closing it.");
-      circuit_mark_for_close(TO_CIRCUIT(circuit), END_CIRC_REASON_NONE);
-      return;
+      reason = END_CIRC_REASON_NONE;
+      goto err;
     } else {
       tor_assert(circuit->build_state->is_internal);
       log_info(LD_CIRC|LD_REND, "We have just finished an introduction "
@@ -1649,7 +1649,7 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
       }
 
       circuit_has_opened(circuit);
-      return;
+      goto done;
     }
   }
 
@@ -1695,9 +1695,16 @@ rend_service_intro_has_opened(origin_circuit_t *circuit)
     goto err;
   }
 
-  return;
+  goto done;
+
  err:
   circuit_mark_for_close(TO_CIRCUIT(circuit), reason);
+ done:
+  memset(buf, 0, sizeof(buf));
+  memset(auth, 0, sizeof(auth));
+  memset(serviceid, 0, sizeof(serviceid));
+
+  return;
 }
 
 /** Called when we get an INTRO_ESTABLISHED cell; mark the circuit as a