diff options
author | FichteFoll <fichtefoll2@googlemail.com> | 2019-09-09 23:53:10 +0200 |
---|---|---|
committer | Michael Homer <mwh@ecs.vuw.ac.nz> | 2019-11-02 12:58:18 +1300 |
commit | 363bc123d077d764cb73556e95b05d8fe1a8b1f8 (patch) | |
tree | 4e9c8eff7c2b24ad43f04a16c1f5613c8570dfb8 /dragon.c | |
parent | Prevent memory corruption by checking MAX_SIZE (diff) | |
download | dragon-363bc123d077d764cb73556e95b05d8fe1a8b1f8.tar.gz dragon-363bc123d077d764cb73556e95b05d8fe1a8b1f8.tar.bz2 dragon-363bc123d077d764cb73556e95b05d8fe1a8b1f8.zip |
uri_collection needs to hold one more item than max
Because the last item needs to be NULL and is written in
`drag_data_get`.
Diffstat (limited to 'dragon.c')
-rw-r--r-- | dragon.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -393,8 +393,8 @@ int main (int argc, char **argv) { exit(0); } - if(drag_all){ - uri_collection = malloc(sizeof(char*) * (argc > MAX_SIZE? argc: MAX_SIZE)); + if (drag_all) { + uri_collection = malloc(sizeof(char*) * ((argc > MAX_SIZE ? argc : MAX_SIZE) + 1)); uri_count = 0; } |