瀏覽代碼

[tls] Fix wrong memset in function tls_clear_cipher

sizeof(cipherspec) is obviously wrong in this context, because it will
only zero the first 4 or 8 bytes (cipherspec is a pointer).

This problem was reported by cppcheck.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Stefan Weil 12 年之前
父節點
當前提交
dcccb1fb7b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      src/net/tls.c

+ 1
- 1
src/net/tls.c 查看文件

594
 			       cipherspec->pubkey_ctx );
594
 			       cipherspec->pubkey_ctx );
595
 	}
595
 	}
596
 	free ( cipherspec->dynamic );
596
 	free ( cipherspec->dynamic );
597
-	memset ( cipherspec, 0, sizeof ( cipherspec ) );
597
+	memset ( cipherspec, 0, sizeof ( *cipherspec ) );
598
 	cipherspec->suite = &tls_cipher_suite_null;
598
 	cipherspec->suite = &tls_cipher_suite_null;
599
 }
599
 }
600
 
600
 

Loading…
取消
儲存