mainGnuTLS - Support: sr #107605, Uninitialized variable...

 
 

sr #107605: Uninitialized variable "md" use in file_verify_clearsign()

Submitter:  Vitaly Kruglikov <vitalyk>
Submitted:  Sat 26 Feb 2011 02:41:47 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  nmav
Open/Closed:  Closed Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 25 Mar 2011 07:50:35 PM UTC, comment #2: 

Actually -- Coverity flagged this and many other potential issues in gnutls library and utilities.  I filed a few of them on this site, but there are too many for me alone to investigate and file.  If someone on the gnutls team has access to Coverity, I would highly recommend running it.

Vitaly Kruglikov <vitalyk>
Fri 25 Mar 2011 07:37:25 PM UTC, comment #1: 

Nice catch. I've commited a fix (for some reason I didn't receive this report on time, thus it will be included in the first 2.12.x bugfix release).

Nikos Mavrogiannopoulos <nmav>
Group administrator
Sat 26 Feb 2011 02:41:47 AM UTC, original submission:  

in gnutls v2.10.4:

md is declared as uninitialzed:

>>

171  file_verify_clearsign (cdk_ctx_t hd, const char *file, const char *output)
172  {
173    cdk_stream_t inp = NULL, out = NULL, tmp = NULL;
Event var_decl: Declared variable "md" without initializer
174    digest_hd_st md;
<<

then, if the algorithm string is invalid, it goes to leave without initializing "md" variable:

>>

236    if (digest_algo && _gnutls_hash_get_algo_len (digest_algo) <= 0)
237      {
238        rc = CDK_Inv_Algo;
239        goto leave;
240      }
<<

After "leave" label, the variable "md" is used:

>>

310  leave:
311    _gnutls_hash_deinit (&md, NULL);
<<

Vitaly Kruglikov <vitalyk>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nmav (Posted a comment)
  • -email is unavailable- added by vitalyk (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-04-10 nmav Open/ClosedOpen Closed
    2011-03-25 nmav StatusNone Done
        Assigned toNone nmav

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code