biod.pnpi.spb.ru
/
alexxy
/
gromacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab9d7e2
)
Fix memory-usage error in g_chi
author
David van der Spoel
<spoel@xray.bmc.uu.se>
Thu, 12 Jun 2014 07:58:11 +0000
(09:58 +0200)
committer
Gerrit Code Review
<gerrit@gerrit.gromacs.org>
Fri, 13 Jun 2014 15:48:52 +0000
(17:48 +0200)
Out of array bounds writing error as pointed out by valgrind
is fixed by this patch, preventing a SEGV.
Fixes #1503
Change-Id: I57959f4751f3eb645ff66bbcd4418607af56c1a4
src/tools/anadih.c
patch
|
blob
|
history
diff --git
a/src/tools/anadih.c
b/src/tools/anadih.c
index 5f5da0eefba94486a9cf09ebfc4f653ca0e5e3bc..1c0e9000dd9a08a4cd0da1ffd5d56d0fd17b44d2 100644
(file)
--- a/
src/tools/anadih.c
+++ b/
src/tools/anadih.c
@@
-417,7
+417,8
@@
void mk_chi_lookup (int **lookup, int maxchi, real **dih,
int i, j, Dih, Chi;
j = 0;
- for (Dih = 0; (Dih < NONCHI+maxchi); Dih++)
+ /* NONCHI points to chi1, therefore we have to start counting there. */
+ for (Dih = NONCHI; (Dih < NONCHI+maxchi); Dih++)
{
for (i = 0; (i < nlist); i++)
{