Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
corepkgv2
Commits
4a194048
Commit
4a194048
authored
4 years ago
by
Vivek Naik
Browse files
Options
Downloads
Patches
Plain Diff
bug fix: update pack file data
now length check is on encrypted data if encryption is on
parent
2e47495e
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!197
Mep release 15052020
,
!196
bug fix: update pack file data
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dalmdl/corefdb/filetype/pack.go
+12
-4
dalmdl/corefdb/filetype/pack.go
with
12 additions
and
4 deletions
dalmdl/corefdb/filetype/pack.go
+
12
−
4
View file @
4a194048
...
...
@@ -817,14 +817,22 @@ func updateSingleRecordInPackFileUsingFp(f *os.File, recordToUpdateIndexRow gjso
}
else
{
existingIndexRows
=
*
infileIndex
}
if
len
(
updatedDataStr
)
<=
len
(
string
(
existingData
))
{
newDataSize
,
err
=
addFileDataInFile
(
f
,
fileStartOffset
,
updatedDataStr
,
false
,
rs
,
securityProvider
)
updatedDataSize
:=
len
(
updatedDataStr
)
updatedDataBytes
:=
[]
byte
(
updatedDataStr
)
if
securityProvider
!=
nil
{
updatedDataBytes
,
err
=
securityProvider
.
Encrypt
(
updatedDataBytes
,
f
.
Name
(),
rs
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
updatedDataSize
=
len
(
updatedDataBytes
)
}
if
int64
(
updatedDataSize
)
<=
dataSize
{
newDataSize
,
err
=
addByteDataInFile
(
f
,
fileStartOffset
,
updatedDataBytes
,
false
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
}
else
{
newDataSize
,
err
=
addFileDataInFile
(
f
,
footerStartOffset
,
updatedDataStr
,
true
,
rs
,
securityProvider
)
newDataSize
,
err
=
addByteDataInFile
(
f
,
footerStartOffset
,
updatedDataBytes
,
true
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets