<div dir="ltr"><div>This looks OK. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 27, 2021 at 7:32 PM Harrison Edward Gerber <<a href="mailto:gerberhe11@gmail.com">gerberhe11@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Harrison Edward Gerber <<a href="mailto:gerberhe11@gmail.com" target="_blank">gerberhe11@gmail.com</a>><br>
<br>
See also CID 1399727<br>
<br>
Closes #4444<br>
---<br>
cpukit/libmisc/monitor/mon-editor.c | 12 +++++++++++-<br>
1 file changed, 11 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/cpukit/libmisc/monitor/mon-editor.c b/cpukit/libmisc/monitor/mon-editor.c<br>
index dcea9fcc69..4287b399a5 100644<br>
--- a/cpukit/libmisc/monitor/mon-editor.c<br>
+++ b/cpukit/libmisc/monitor/mon-editor.c<br>
@@ -360,7 +360,17 @@ rtems_monitor_line_editor (<br>
{<br>
int bs;<br>
pos--;<br>
- strcpy (buffer + pos, buffer + pos + 1);<br>
+<br>
+ /*<br>
+ * Memory operation used here instead of string <br>
+ * method due the src and dest of buffer overlapping.<br>
+ */<br>
+ memmove(<br>
+ buffer + pos, <br>
+ buffer + pos + 1, <br>
+ RTEMS_COMMAND_BUFFER_SIZE - pos - 1<br>
+ );<br>
+ buffer[RTEMS_COMMAND_BUFFER_SIZE - 1] = '\0';<br>
fprintf(stdout,"\b%s \b", buffer + pos);<br>
for (bs = 0; bs < ((int) strlen (buffer) - pos); bs++)<br>
putchar ('\b');<br>
-- <br>
2.25.1<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>