about summary refs log tree commit diff stats
path: root/src/LYStrings.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2018-12-27 10:33:52 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2018-12-27 10:33:52 +0000
commit466c1be273ce2f7354532f876250cbc3d9d6cefd (patch)
tree96125dbdd41c4501c72a67daacb90e995b73b72c /src/LYStrings.c
parentfd8ff03480d588c28b9424f2976beadbe7a55a35 (diff)
downloadlynx-snapshots-466c1be273ce2f7354532f876250cbc3d9d6cefd.tar.gz
snapshot of project "lynx", label v2-9-0dev_0b
Diffstat (limited to 'src/LYStrings.c')
-rw-r--r--src/LYStrings.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/LYStrings.c b/src/LYStrings.c
index e1845bb1..3fb31faa 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYStrings.c,v 1.273 2018/05/04 23:29:29 tom Exp $ */
+/* $LynxId: LYStrings.c,v 1.275 2018/12/27 10:32:15 tom Exp $ */
 #include <HTUtils.h>
 #include <HTCJK.h>
 #include <UCAux.h>
@@ -3226,9 +3226,11 @@ int LYEditInsert(FieldEditor * edit, unsigned const char *s,
 		} else
 		    utfbuf[0] = (char) ucode;
 	    }
-	    StrNCpy(Buffer + off, utfbuf, l);
-	    edited = 1;
-	    off += l;
+	    if ((size_t) (off + l) <= BufAlloc) {
+		memcpy(Buffer + off, utfbuf, (size_t) l);
+		edited = 1;
+		off += l;
+	    }
 	    s++;
 	}
 	if (tail)
d='n151' href='#n151'>151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221