Opened 18 years ago

Last modified 7 years ago

#1 assigned defect

sprintf used without checks

Reported by: Bruno Cornec Owned by: Bruno Cornec
Priority: high Milestone: 3.3.1
Component: mondo Version: 2.0.8
Severity: normal Keywords: memory
Cc:

Description

reported by Yann Aubert (<technique_at_alixen.fr>):
many sprintf in mondo code are used without checks and may lead to seg. fault (ex: -E with a long list of excluded directories)

Change History (7)

comment:1 by Bruno Cornec, 18 years ago

Status: newassigned

The whole memory management system of mondo is re-written for 2.2|3.x as there were a lot of potential problems.

comment:2 by Bruno Cornec, 17 years ago

Milestone: 3.0.03.0.1

A big part will be done for 3.0.0, but the end will be for later versions

comment:3 by Bruno Cornec, 15 years ago

Work as started in 2.2.9 and is now extended a lot in 2.2.10 (Cf: http://article.gmane.org/gmane.linux.mondo.devel/12510)

comment:4 by Bruno Cornec, 9 years ago

Milestone: 4.0.13.2.1

Version 3.2.0 brings a huge difference with regards to that:

In 3.0.4:

total sprintf usage : 674
total strcat usage : 20
total strcpy usage : 560
total fgets usage : 79
total malloc_string usage : 367
total MAX_STR_LEN usage : 370

In 3.2.0:

total sprintf usage : 90
total strcat usage : 15
total strcpy usage : 340
total fgets usage : 24
total malloc_string usage : 102
total MAX_STR_LEN usage : 211

As you can see I can't really close that BR as done, but since 8 years I have started to improve stuff on the C part to solve it, and this will be today the first version showing progress on this, so want to write it down here !

Last edited 7 years ago by Bruno Cornec (previous) (diff)

comment:5 by Bruno Cornec, 9 years ago

Milestone: 3.2.13.2.2

In 3.2.1:

total sprintf usage : 85 
total strcpy usage : 338 
total fgets usage : 23
total malloc_string usage : 95
total MAX_STR_LEN usage : 210

Improving slowly as it wasn't the goal of this version.

Last edited 7 years ago by Bruno Cornec (previous) (diff)

comment:6 by Bruno Cornec, 8 years ago

Milestone: 3.2.23.2.3

In 3.2.2, nearly no change.

comment:7 by Bruno Cornec, 7 years ago

Milestone: 3.3.03.3.1

In 3.3.0 again some improvements:

total sprintf usage : 76
total strcpy usage : 289
total fgets usage : 22
total malloc_string usage : 81
total MAX_STR_LEN usage : 182

The remaining ones take much more time, as there is an impact on lots of functions.

Note: See TracTickets for help on using tickets.