Changeset b1559f4c


Ignore:
Timestamp:
Nov 24, 2018, 5:17:29 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
Children:
63bc67b
Parents:
c4a8bc1
Message:

[tempo] fix buffer overflow in method parser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tempo/tempo.c

    rc4a8bc1 rb1559f4c  
    169169{
    170170  aubio_tempo_t * o = AUBIO_NEW(aubio_tempo_t);
    171   char_t specdesc_func[20];
     171  char_t specdesc_func[PATH_MAX];
    172172  o->samplerate = samplerate;
    173173  // check parameters are valid
     
    204204  aubio_peakpicker_set_threshold (o->pp, o->threshold);
    205205  if ( strcmp(tempo_mode, "default") == 0 ) {
    206     strcpy(specdesc_func, "specflux");
     206    strncpy(specdesc_func, "specflux", PATH_MAX - 1);
    207207  } else {
    208     strcpy(specdesc_func, tempo_mode);
     208    strncpy(specdesc_func, tempo_mode, PATH_MAX - 1);
     209    specdesc_func[PATH_MAX - 1] = '\0';
    209210  }
    210211  o->od       = new_aubio_specdesc(specdesc_func,buf_size);
Note: See TracChangeset for help on using the changeset viewer.