# HG changeset patch # User michael # Date 1266706643 0 # Node ID 9a3b8d7062d2761a66e61f7feaf1afff22625b1d # Parent 7dab04a733642ac269884b3bb70ed3df30972f85 Make sure we dont write more bytes into filename than the array is long. just a precaution in case the size of the source array is increased or made dynamically allocateable. diff -r 7dab04a73364 -r 9a3b8d7062d2 mov.c --- a/mov.c Sat Feb 20 22:48:09 2010 +0000 +++ b/mov.c Sat Feb 20 22:57:23 2010 +0000 @@ -1580,7 +1580,7 @@ } /* compose filename if next level down to target was found */ - if (i == ref->nlvl_to - 1) { + if (i == ref->nlvl_to - 1 && src_path - src < sizeof(filename)) { memcpy(filename, src, src_path - src); filename[src_path - src] = 0;