[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-devel] [bug #46241] ImgCrop segfaults with long output file na

From: Vladimir Markelov
Subject: [gnuastro-devel] [bug #46241] ImgCrop segfaults with long output file names
Date: Sun, 31 Jul 2016 23:54:25 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0

Update of bug #46241 (project gnuastro):

                  Status:                    None => In Progress            
             Assigned to:                    None => vvm                    


Follow-up Comment #1:

I found a place where application memory corrupts and makes the application
fail. It may fix bug 45380 as well.



=== Why I fixed it that way ===
I see a few ways to fix the memory corruption at this point:
If we do this we have to change a few other constants
results in a lot of code changes - easy way to break something. Moreover, we
cannot say what will be the maximum file name length, so we have to reserve
decent amount of memory(hundreds of bytes at least)

*2. Do not use GAL_TIMING_VERB_MSG_LENGTH_V for buffer size and choose bigger
Similar to item 1: we do not know for sure the maximum file name length. But
it does not require to change other variables.

*3. Do not use static char buffer for the msg and allocate memory
It is fine for any file name length. The only drawback: I see format string
uses '%-30', so if we use longer strings the output will look ugly because
formatting won't work.

*4. Truncate file name to 30 characters*
It works with any file name and it keeps log output nice-looking because
format string '%-30' works always here.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]