bugConcurrent Versions System - Bugs: bug #35432, cvs rls results in %n in writable...

 
 

bug #35432: cvs rls results in %n in writable segment detected

Submitted by:  None
Submitted on:  Wed 01 Feb 2012 11:00:54 PM UTC  
 
Category: Bug ReportSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenRelease: 
Fixed Release: NoneFixed Feature Release: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 01 Feb 2012 11:00:54 PM UTC, original submission:

I downloaded and compiled the cvs-1.12.13.tar.gz file.
used gcc (Ubuntu 4.3.2-1ubuntu12) 4.3.2

Then when I (or via redmine/cvs) use the cvs rls command I got a lot of :

      • %n in writable segment detected ***

Terminated with fatal signal 11

I did a simple grep "%n" -R * and found something in the file lib/vasnprintf.c

more google/browsing found

http://git.savannah.gnu.org/cgit/gnulib.git/commit/lib/vasnprintf.c?id=913c09becd9df89dbd9b9f386e7f35c240d5efe8

did a minimal change in lib/vasnprintf.c

# if !(_GLIBC_ > 2 || (_GLIBC_ == 2 && _GLIBC_MINOR_ >= 3))
p[1] = '%';
p[2] = 'n';
p[3] = '\0';
#else

/* On glibc2 systems from glibc >= 2.3 - probably also older
ones - we know that snprintf's returns value conforms to
ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
Therefore we can avoid using %n in this situation.
On glibc2 systems from 2004-10-18 or newer, the use of %n
in format strings in writable memory may crash the program
(if compiled with _FORTIFY_SOURCE=2), so we should avoid it
in this situation. */
p[1] = '\0';
#endif

and now it works!

I also found the bug #29199 which may apply to this.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup