summaryrefslogtreecommitdiff
blob: 1f24b67471e20c540202e0df58c7f6bfc54acce9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- atftp-0.7/tftpd_pcre.c~	2005-10-17 23:14:52.000000000 +0200
+++ atftp-0.7/tftpd_pcre.c	2005-10-17 23:14:52.000000000 +0200
@@ -211,9 +211,9 @@
                chp++; /* point to value indicating substring */
                rc = pcre_get_substring(str, ovector, matches, *chp - 0x30, &tmpstr);
                /* found string */
-               if (rc > 0)
+               if (rc > 0 && outchp - outstr + rc+1 < outsize)
                {
-                    Strncpy(outchp, tmpstr, rc);
+                    Strncpy(outchp, tmpstr, rc+1);
                     outchp += rc;
                     pcre_free_substring(tmpstr);
                     continue;