Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #20581

Closed (moved)
(moved)
Open
Created Nov 05, 2016 by Trac@tracbot

warning: 'enc_b64_blob' may be used uninitialized in this function

I'm seeing:

src/or/hs_descriptor.c: In function 'desc_encode_v3':
src/or/hs_descriptor.c:787: warning: 'enc_b64_blob' may be used uninitialized in this function

It looks like any situation where enc_b64_blob doesn't get initialised it also doesn't get used, and clang doesn't complain, so I think this is just OpenBSD's old gcc being silly but could it be initialised to make it happy?

diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c
index 7c5d204..bc72034 100644
--- a/src/or/hs_descriptor.c
+++ b/src/or/hs_descriptor.c
@@ -784,7 +784,7 @@ desc_encode_v3(const hs_descriptor_t *desc, char **encoded_out)
 
   /* Build the encrypted data section. */
   {
-    char *enc_b64_blob;
+    char *enc_b64_blob = NULL;
     if (encode_encrypted_data(desc, &enc_b64_blob) < 0) {
       goto err;
     }

(I didn't want to make a new ticket for this but trac wouldn't let me post it on #18571 (moved), sorry)

Trac:
Username: rubiate

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking