File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ void BbRewindBuffer(PBYTE_BUFFER buff) {
55
55
// Get a variable number of bytes from the byte buffer (all or nothing though)
56
56
bool BbGetBytes (PBYTE_BUFFER buff , uint8_t * data , int length ) {
57
57
if (buff -> position + length > buff -> length ) {
58
+ memset (data , 0 , length );
58
59
return false;
59
60
}
60
61
@@ -72,6 +73,7 @@ bool BbGet8(PBYTE_BUFFER buff, uint8_t* c) {
72
73
// Get a short from the byte buffer
73
74
bool BbGet16 (PBYTE_BUFFER buff , uint16_t * s ) {
74
75
if (buff -> position + sizeof (* s ) > buff -> length ) {
76
+ * s = 0 ;
75
77
return false;
76
78
}
77
79
@@ -86,6 +88,7 @@ bool BbGet16(PBYTE_BUFFER buff, uint16_t* s) {
86
88
// Get an int from the byte buffer
87
89
bool BbGet32 (PBYTE_BUFFER buff , uint32_t * i ) {
88
90
if (buff -> position + sizeof (* i ) > buff -> length ) {
91
+ * i = 0 ;
89
92
return false;
90
93
}
91
94
@@ -100,6 +103,7 @@ bool BbGet32(PBYTE_BUFFER buff, uint32_t* i) {
100
103
// Get a long from the byte buffer
101
104
bool BbGet64 (PBYTE_BUFFER buff , uint64_t * l ) {
102
105
if (buff -> position + sizeof (* l ) > buff -> length ) {
106
+ * l = 0 ;
103
107
return false;
104
108
}
105
109
You can’t perform that action at this time.
0 commit comments