Changeset 396
- Timestamp:
- 03/03/06 11:43:57
- Files:
-
- openpgpsdk/trunk/src/accumulate.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openpgpsdk/trunk/src/accumulate.c
r395 r396 18 18 { 19 19 ops_keyring_t *keyring; 20 ops_boolean_t accumulating:1;21 20 } accumulate_arg_t; 22 21 … … 30 29 const ops_parser_content_union_t *content=&content_->content; 31 30 ops_keyring_t *keyring=arg->keyring; 32 ops_key_data_t *cur= &keyring->keys[keyring->nkeys];31 ops_key_data_t *cur=NULL; 33 32 const ops_public_key_t *pkey; 33 34 if(keyring->nkeys >= 0) 35 cur=&keyring->keys[keyring->nkeys]; 34 36 35 37 switch(content_->tag) 36 38 { 37 case OPS_PARSER_PTAG:38 arg->accumulating=ops_false;39 break;40 41 39 case OPS_PTAG_CT_PUBLIC_KEY: 42 40 case OPS_PTAG_CT_SECRET_KEY: 43 41 case OPS_PTAG_CT_ENCRYPTED_SECRET_KEY: 44 42 // printf("New key\n"); 45 arg->accumulating=ops_true;46 43 ++keyring->nkeys; 47 44 EXPAND_ARRAY(keyring,keys); … … 68 65 case OPS_PTAG_CT_USER_ID: 69 66 // printf("User ID: %s\n",content->user_id.user_id); 70 assert( arg->accumulating);67 assert(cur); 71 68 EXPAND_ARRAY(cur,uids); 72 69 cur->uids[cur->nuids++]=content->user_id; … … 74 71 75 72 case OPS_PARSER_PACKET_END: 76 if(! arg->accumulating)73 if(!cur) 77 74 return OPS_RELEASE_MEMORY; 78 75
