소스 검색

Fix a heap overrun in test_decode_plaintext

Nick Mathewson 7 년 전
부모
커밋
1a03edefba
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/test/test_hs_descriptor.c

+ 1 - 0
src/test/test_hs_descriptor.c

@@ -987,6 +987,7 @@ test_decode_plaintext(void *arg)
     tt_int_op(HS_DESC_MAX_LEN, <, big);
     char *plaintext = tor_malloc_zero(big);
     memset(plaintext, 'a', big);
+    plaintext[big - 1] = '\0';
     ret = hs_desc_decode_plaintext(plaintext, &desc_plaintext);
     tor_free(plaintext);
     tt_int_op(ret, OP_EQ, -1);