Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Unified Diff: src/hunspell/suggestmgr.cxx

Issue 300233002: [hunspell] Fix read from uninit memory. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/hunspell.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « google.patch ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hunspell/suggestmgr.cxx
diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx
index c3477df7af93583a5f3bf93c35628166410b9048..e94ab3ec3bb73a9aa0dcf6b50564da7aa229b981 100644
--- a/src/hunspell/suggestmgr.cxx
+++ b/src/hunspell/suggestmgr.cxx
@@ -2108,8 +2108,8 @@ void SuggestMgr::lcs(const char * s, const char * s2, int * l1, int * l2, char *
m = strlen(s);
n = strlen(s2);
}
- c = (char *) malloc((m + 1) * (n + 1));
- b = (char *) malloc((m + 1) * (n + 1));
+ c = (char *) calloc((m + 1) * (n + 1));
+ b = (char *) calloc((m + 1) * (n + 1));
Avi (use Gerrit) 2014/05/27 20:04:05 No, calloc doesn't work that way. calloc takes two
if (!c || !b) {
if (c) free(c);
if (b) free(b);
« no previous file with comments | « google.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698