Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
dalvik
Commits
0f5ea2fc
Commit
0f5ea2fc
authored
9 years ago
by
Aart Bik
Committed by
The Android Automerger
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Fix potential buffer overrun.
BUG=27840771 Change-Id: I240f188b2e8f4b45d90138cfb3b14869cf506452
parent
f8ed7d3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
libdex/OptInvocation.cpp
libdex/OptInvocation.cpp
+5
-5
No files found.
libdex/OptInvocation.cpp
View file @
0f5ea2fc
...
...
@@ -87,9 +87,9 @@ char* dexOptGenerateCacheFileName(const char* fileName, const char* subFileName)
ALOGE
(
"Can't get CWD while opening jar file"
);
return
NULL
;
}
strncat
(
absoluteFile
,
"/"
,
kBufLen
);
strncat
(
absoluteFile
,
"/"
,
kBufLen
-
strlen
(
absoluteFile
)
);
}
strncat
(
absoluteFile
,
fileName
,
kBufLen
);
strncat
(
absoluteFile
,
fileName
,
kBufLen
-
strlen
(
absoluteFile
)
);
/*
* Append the name of the Jar file entry, if any. This is not currently
...
...
@@ -97,8 +97,8 @@ char* dexOptGenerateCacheFileName(const char* fileName, const char* subFileName)
* in a Jar.
*/
if
(
subFileName
!=
NULL
)
{
strncat
(
absoluteFile
,
"/"
,
kBufLen
);
strncat
(
absoluteFile
,
subFileName
,
kBufLen
);
strncat
(
absoluteFile
,
"/"
,
kBufLen
-
strlen
(
absoluteFile
)
);
strncat
(
absoluteFile
,
subFileName
,
kBufLen
-
strlen
(
absoluteFile
)
);
}
/* Turn the path into a flat filename by replacing
...
...
@@ -136,7 +136,7 @@ char* dexOptGenerateCacheFileName(const char* fileName, const char* subFileName)
/* Tack on the file name for the actual cache file path.
*/
strncat
(
nameBuf
,
absoluteFile
,
kBufLen
);
strncat
(
nameBuf
,
absoluteFile
,
kBufLen
-
strlen
(
nameBuf
)
);
ALOGV
(
"Cache file for '%s' '%s' is '%s'"
,
fileName
,
subFileName
,
nameBuf
);
return
strdup
(
nameBuf
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment