-
-
Notifications
You must be signed in to change notification settings - Fork 265
Added default initialization to avoid garbage values #8973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
fd6857c
a6988a4
4e97b5c
7ec3f4b
a6db65e
0fe3203
533aab5
64963c8
bfa093b
f335f7c
30810af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1608,7 +1608,7 @@ bool get_acl(BurpGlobals* tdgbl, const TEXT* owner_nm, ISC_QUAD* blob_id, ISC_QU | |
|
|
||
| ULONG length = 0; | ||
| UCHAR item; | ||
| USHORT max_segment; | ||
| USHORT max_segment = 0; | ||
| ULONG num_segments; | ||
| const UCHAR* p = blob_info; | ||
|
|
||
|
|
@@ -1783,7 +1783,7 @@ void get_array(BurpGlobals* tdgbl, burp_rel* relation, UCHAR* record_buffer) | |
| SLONG fld_ranges[2 * MAX_DIMENSION]; | ||
| SLONG slice_length = 0; | ||
| SLONG *range; | ||
| const SLONG* end_ranges; | ||
| const SLONG* end_ranges = nullptr; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| scan_attr_t scan_next_attr; | ||
| skip_init(&scan_next_attr); | ||
| att_type attribute; | ||
|
|
@@ -1851,7 +1851,7 @@ void get_array(BurpGlobals* tdgbl, burp_rel* relation, UCHAR* record_buffer) | |
| SLONG last_element_dim[MAX_DIMENSION]; | ||
| if (return_length != slice_length) | ||
| { | ||
| int upper, lower; | ||
| int upper = 0, lower = 0; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is remains of old C code. Move this declaration to usage instead. |
||
| // | ||
| // Ugh! The full array wasn't returned and versions of gbak prior to | ||
| // V3.2I don't explicitly signal this. We must recompute the top | ||
|
|
@@ -3386,7 +3386,7 @@ void get_data(BurpGlobals* tdgbl, burp_rel* relation, WriteRelationReq* req) | |
| } | ||
| } | ||
|
|
||
| UCHAR* p; | ||
| UCHAR* p = nullptr; | ||
| if (tdgbl->gbl_sw_transportable) | ||
| { | ||
| if (get(tdgbl) != att_xdr_length) | ||
|
|
@@ -9097,7 +9097,7 @@ bool get_db_creator(BurpGlobals* tdgbl) | |
| att_type attribute; | ||
| scan_attr_t scan_next_attr; | ||
| TEXT usr[GDS_NAME_LEN]; | ||
| SSHORT uType; | ||
| SSHORT uType = 0; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pointless because of initialization of |
||
| bool userSet, typeSet; | ||
|
|
||
| userSet = typeSet = false; | ||
|
|
@@ -9422,7 +9422,7 @@ bool get_trigger_old (BurpGlobals* tdgbl, burp_rel* relation) | |
| * Get a trigger definition for a relation. | ||
| * | ||
| **************************************/ | ||
| enum trig_t type; | ||
| enum trig_t type = trig_none; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For completeness you should also add a check that a meaningful value was assigned below and throw an error if |
||
| att_type attribute; | ||
| TEXT name[GDS_NAME_LEN]; | ||
| scan_attr_t scan_next_attr; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -227,7 +227,8 @@ static void checkForeignKeyTempScope(thread_db* tdbb, jrd_tra* transaction, | |
| { | ||
| AutoCacheRequest request(tdbb, drq_l_rel_info, DYN_REQUESTS); | ||
| QualifiedName masterRelName; | ||
| rel_t masterType, childType; | ||
| rel_t masterType = rel_persistent; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is basically wrong and will fail in the case if the table has several foreign keys. It must be fixed, not polished. |
||
| rel_t childType = rel_persistent; | ||
|
|
||
| FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) | ||
| RLC_M IN RDB$RELATION_CONSTRAINTS CROSS | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -973,7 +973,7 @@ USHORT CVT2_make_string2(const dsc* desc, TTypeId to_interp, UCHAR** address, Mo | |
| **************************************/ | ||
| UCHAR* from_buf; | ||
| USHORT from_len; | ||
| TTypeId from_interp; | ||
| USHORT from_interp = 0; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First, replacing a specific type with a generic one is a bad idea. |
||
|
|
||
| fb_assert(desc != NULL); | ||
| fb_assert(address != NULL); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong initialization. In this case
USHRT_MAXis a safe assumption.