Skip to content

Commit f2f8f4a

Browse files
committed
deimos.openssl: Fix non-zero struct initial values
These would have required that the Deimos bindings were compiled and linked into the application if said struct was used without "= void".
1 parent 44348cc commit f2f8f4a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

source/deimos/openssl/asn1t.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ enum ASN1_TFLG_NDEF = (0x1<<11);
564564
/* This is the actual ASN1 item itself */
565565

566566
struct ASN1_ITEM_st {
567-
char itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */
567+
ubyte itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */
568568
c_long utype; /* underlying type */
569569
const(ASN1_TEMPLATE)* templates; /* If SEQUENCE or CHOICE this contains the contents */
570570
c_long tcount; /* Number of templates if SEQUENCE or CHOICE */
@@ -639,7 +639,7 @@ enum ASN1_ITYPE_NDEF_SEQUENCE = 0x6;
639639
*/
640640

641641
struct ASN1_TLC_st{
642-
char valid; /* Values below are valid */
642+
ubyte valid; /* Values below are valid */
643643
int ret; /* return value */
644644
c_long plen; /* length */
645645
int ptag; /* class value */

source/deimos/openssl/camellia.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ alias uint[CAMELLIA_TABLE_WORD_LEN] KEY_TABLE_TYPE; /* to match with WORD */
8080
struct camellia_key_st
8181
{
8282
union u_ {
83-
double d; /* ensures 64-bit align */
83+
double d = void; /* ensures 64-bit align */
8484
KEY_TABLE_TYPE rd_key;
8585
}
8686
u_ u;

source/deimos/openssl/kssl.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ enum KSSL_CLOCKSKEW = 300;;
126126
enum KSSL_ERR_MAX = 255;
127127
struct kssl_err_st {
128128
int reason;
129-
char[KSSL_ERR_MAX+1] text;
129+
char[KSSL_ERR_MAX+1] text = 0;
130130
}
131131
alias kssl_err_st KSSL_ERR;
132132

source/deimos/openssl/ssl3.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ version(OPENSSL_NO_ECDH) {} else {
509509
/* used for certificate requests */
510510
int cert_req;
511511
int ctype_num;
512-
char[SSL3_CT_NUMBER] ctype;
512+
char[SSL3_CT_NUMBER] ctype = 0;
513513
STACK_OF!(X509_NAME) *ca_names;
514514

515515
int use_rsa_tmp;
@@ -547,7 +547,7 @@ version(OPENSSL_NO_EC) {} else {
547547
/* This is set to true if we believe that this is a version of Safari
548548
* running on OS X 10.6 or newer. We wish to know this because Safari
549549
* on 10.8 .. 10.8.3 has broken ECDHE-ECDSA support. */
550-
char is_probably_safari;
550+
char is_probably_safari = 0;
551551
} /* !OPENSSL_NO_EC */
552552
} /* !OPENSSL_NO_TLSEXT */
553553
}

0 commit comments

Comments
 (0)