Sfoglia il codice sorgente

dialog: Allocate space for terminator when building filter string

DevonArtmeier 1 anno fa
parent
commit
65a04a772e
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/dialog/SDL_dialog_utils.c

+ 1 - 1
src/dialog/SDL_dialog_utils.c

@@ -54,7 +54,7 @@ char *convert_filters(const SDL_DialogFileFilter *filters, NameTransform ntf,
 
 
         terminator = f[1].name ? separator : suffix;
         terminator = f[1].name ? separator : suffix;
         new_length = SDL_strlen(combined) + SDL_strlen(converted)
         new_length = SDL_strlen(combined) + SDL_strlen(converted)
-                   + SDL_strlen(terminator);
+                   + SDL_strlen(terminator) + 1;
 
 
         new_combined = SDL_realloc(combined, new_length);
         new_combined = SDL_realloc(combined, new_length);