Opened 11 years ago

Last modified 7 months ago

#1 assigned defect

sprintf used without checks

Reported by: bruno Owned by: bruno
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 Changed 11 years ago by bruno

  • Status changed from new to assigned

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 Changed 10 years ago by bruno

  • Milestone changed from 3.0.0 to 3.0.1

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

comment:3 Changed 8 years ago by bruno

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 Changed 3 years ago by bruno

  • Milestone changed from 4.0.1 to 3.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 months ago by bruno (previous) (diff)

comment:5 Changed 2 years ago by bruno

  • Milestone changed from 3.2.1 to 3.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 months ago by bruno (previous) (diff)

comment:6 Changed 18 months ago by bruno

  • Milestone changed from 3.2.2 to 3.2.3

In 3.2.2, nearly no change.

comment:7 Changed 7 months ago by bruno

  • Milestone changed from 3.3.0 to 3.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.