mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Assert that an opaque parameter is really what we expect.
* g10/gpg.h (SERVER_CONTROL_MAGIC): New const. (server_control_s): Add field 'magic'. * g10/gpg.c (gpg_init_default_ctrl): Init MAGIC. * g10/import.c (impex_filter_getval): Assert MAGIC. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
8f2671d2cc
commit
52ba5e67ca
3 changed files with 12 additions and 1 deletions
|
@ -1182,6 +1182,8 @@ impex_filter_getval (void *cookie, const char *propname)
|
|||
static char numbuf[20];
|
||||
const char *result;
|
||||
|
||||
log_assert (ctrl && ctrl->magic == SERVER_CONTROL_MAGIC);
|
||||
|
||||
if (node->pkt->pkttype == PKT_USER_ID
|
||||
|| node->pkt->pkttype == PKT_ATTRIBUTE)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue