All pastes #73111 Raw Edit

Something

public text v1 · immutable
#73111 ·published 2006-06-27 13:37 UTC
rendered paste body
$ rats --no-recursion --context src/*.cpp -w 1
Entries in perl database: 33
Entries in python database: 62
Entries in c database: 334
Entries in php database: 55
Analyzing src/collision.cpp
Analyzing src/collision_grid.cpp
Analyzing src/console.cpp
Analyzing src/fadeout.cpp
Analyzing src/file_system.cpp
Analyzing src/flip_level_transformer.cpp
Analyzing src/game_object.cpp
Analyzing src/game_session.cpp
Analyzing src/gameconfig.cpp
Analyzing src/level.cpp
Analyzing src/level_transformer.cpp
Analyzing src/log.cpp
Analyzing src/main.cpp
Analyzing src/mainloop.cpp
Analyzing src/moving_object.cpp
Analyzing src/object_factory.cpp
Analyzing src/options_menu.cpp
Analyzing src/physic.cpp
Analyzing src/player_status.cpp
Analyzing src/random_generator.cpp
Analyzing src/resources.cpp
Analyzing src/sector.cpp
Analyzing src/shrinkfade.cpp
Analyzing src/spawn_point.cpp
Analyzing src/statistics.cpp
Analyzing src/textscroller.cpp
Analyzing src/tile.cpp
Analyzing src/tile_manager.cpp
Analyzing src/timer.cpp
Analyzing src/title.cpp
Analyzing src/world.cpp
src/game_session.cpp:181: High: fixed size local buffer
  char buf[30];                            // save the seed in the demo file
src/game_session.cpp:204: High: fixed size local buffer
  char buf[30];                            // recall the seed from the demo file
src/game_session.cpp:221: High: fixed size local buffer
  char str[60];
src/main.cpp:91: High: fixed size local buffer
  char* writedir = new char[strlen(userdir) + strlen(application) + 2];
src/main.cpp:97: High: fixed size local buffer
    char* mkdir = new char[strlen(application) + 2];
src/main.cpp:131: High: fixed size local buffer
        char* str = new char[strlen(d) + strlen(dirsep) + l + 1];
src/mainloop.cpp:114: High: fixed size local buffer
  char str[60];
src/player_status.cpp:138: High: fixed size local buffer
  char str[60];
src/resources.cpp:73: High: fixed size local buffer
  char img_name[1024];
src/statistics.cpp:114: High: fixed size local buffer
  char caption_buf[128];
src/statistics.cpp:115: High: fixed size local buffer
  char stat_buf[128];
src/statistics.cpp:168: High: fixed size local buffer
  char str[128];
src/statistics.cpp:225: High: fixed size local buffer
  char buf[129];
Extra care should be taken to ensure that character arrays that are allocated
on the stack are used safely.  They are prime targets for buffer overflow
attacks.

src/main.cpp:94: High: sprintf
  sprintf(writedir, "%s.%s", userdir, application);
src/main.cpp:98: High: sprintf
    sprintf(mkdir, ".%s", application);
src/main.cpp:132: High: sprintf
        sprintf(str, "%s%s%s", d, dirsep, *i);
src/statistics.cpp:119: High: sprintf
      sprintf(caption_buf, _("Max coins collected:"));
src/statistics.cpp:123: High: sprintf
      sprintf(caption_buf, _("Max fragging:"));
src/statistics.cpp:127: High: sprintf
      sprintf(caption_buf, _("Min time needed:"));
src/statistics.cpp:136: High: sprintf
      sprintf(caption_buf, _("Max secrets found:"));
src/statistics.cpp:171: High: sprintf
  sprintf(str, _("Max coins collected:   %d / %d"), coins, total_coins);
src/statistics.cpp:175: High: sprintf
  sprintf(str, _("Max fragging:          %d / %d"), badguys, total_badguys);
src/statistics.cpp:182: High: sprintf
  sprintf(str, _("Min time needed:       %02d:%02d"), mins,secs);
src/statistics.cpp:186: High: sprintf
  sprintf(str, _("Max secrets found:     %d / %d"), secrets, total_secrets);
Check to be sure that the format string passed as argument 2 to this function
call does not come from an untrusted source that could have added formatting
characters that the code is not prepared to handle.  Additionally, the format
string could contain `%s' without precision that could result in a buffer
overflow.

src/main.cpp:200: High: fprintf
  fprintf(stderr, _("Usage: %s [OPTIONS] [LEVELFILE]\n\n"), argv0);
src/main.cpp:201: High: fprintf
  fprintf(stderr,
Check to be sure that the non-constant format string passed as argument 2 to
this function call does not come from an untrusted source that could have added
formatting characters that the code is not prepared to handle.

src/statistics.cpp:119: High: sprintf
      sprintf(caption_buf, _("Max coins collected:"));
src/statistics.cpp:123: High: sprintf
      sprintf(caption_buf, _("Max fragging:"));
src/statistics.cpp:127: High: sprintf
      sprintf(caption_buf, _("Min time needed:"));
src/statistics.cpp:136: High: sprintf
      sprintf(caption_buf, _("Max secrets found:"));
src/statistics.cpp:171: High: sprintf
  sprintf(str, _("Max coins collected:   %d / %d"), coins, total_coins);
src/statistics.cpp:175: High: sprintf
  sprintf(str, _("Max fragging:          %d / %d"), badguys, total_badguys);
src/statistics.cpp:182: High: sprintf
  sprintf(str, _("Min time needed:       %02d:%02d"), mins,secs);
src/statistics.cpp:186: High: sprintf
  sprintf(str, _("Max secrets found:     %d / %d"), secrets, total_secrets);
Check to be sure that the non-constant format string passed as argument 2 to
this function call does not come from an untrusted source that could have added
formatting characters that the code is not prepared to handle.

Total lines analyzed: 7392
Total time 0.012588 seconds
587225 lines per second