AMBER Archive (2008)

Subject: Re: AMBER: PROBLEM: AmberTools Installation using Ubuntu

From: Mark Williamson (
Date: Sat Jun 14 2008 - 10:13:18 CDT

Jens Lattig wrote:
> ==============================================================
> cd antechamber/c60 && ./Run.c60
> *** stack smashing detected ***: ../../../exe/antechamber terminated
> ======= Backtrace: =========
> /lib/tls/i686/cmov/[0x40142138]
> /lib/tls/i686/cmov/[0x401420f0]
> ../../../exe/antechamber[0x806faf6]

In the rjcrt() function, ($AMBERHOME/src/antechamber/jcrt.c), the array
defined at

char tmpchar[10];

is too small to hold the line "basis=6-31G*" when reading in the
buckyball.jcrt file, hence the end of this array is overwritten. This is
generally a "bad thing", since it may be possible to pervert the normal
flow of a program and get it to do things that it should not. This can
be fixed in one of two ways:

a) Increasing the tmpchar array size:

        char tmpchar[15]

b) Telling sscanf() exactly how many characters it can accept; if
tmpchar[10], then sscanf should be:

        sscanf(line, "%9s", tmpchar);

The one character difference is to account for the terminating null byte
in the array.

I think a combination of these both would be a good idea, since only
applying a) means that a longer user supplied line could crash
antechamber and only applying b) means that the basis string would be
truncated at 6-31 instead of the whole 6-31G*.



The AMBER Mail Reflector
To post, send mail to
To unsubscribe, send "unsubscribe amber" (in the *body* of the email)