projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Dont smash aoview_monitor_parse input buffer
[fw/altos]
/
aoview
/
aoview_monitor.c
diff --git
a/aoview/aoview_monitor.c
b/aoview/aoview_monitor.c
index f7f646ae817b7792487607e585f40f70244e1753..5810be5b91fb006117ac57f048421685a1a86930 100644
(file)
--- a/
aoview/aoview_monitor.c
+++ b/
aoview/aoview_monitor.c
@@
-68,12
+68,17
@@
aoview_parse_pos(double *target, char *source)
static struct aostate state;
gboolean
static struct aostate state;
gboolean
-aoview_monitor_parse(c
har *
line)
+aoview_monitor_parse(c
onst char *input_
line)
{
char *saveptr;
char *words[64];
int nword;
{
char *saveptr;
char *words[64];
int nword;
+ char line_buf[8192], *line;
+ /* avoid smashing our input parameter */
+ strncpy (line_buf, input_line, sizeof (line_buf)-1);
+ line_buf[sizeof(line_buf) - 1] = '\0';
+ line = line_buf;
for (nword = 0; nword < 64; nword++) {
words[nword] = strtok_r(line, " \t\n", &saveptr);
line = NULL;
for (nword = 0; nword < 64; nword++) {
words[nword] = strtok_r(line, " \t\n", &saveptr);
line = NULL;