summaryrefslogtreecommitdiff
path: root/src/bin/embryo
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-09-01 18:53:49 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-09-01 19:40:46 +0900
commitea3d28d0c3fa7dbf286f955b3e0edbb7f01e0d7c (patch)
tree4d319e45b30ed940a62430a95aa5cf9582a496e2 /src/bin/embryo
parent1b74f19b60ed46eb28b6e3469227fb733e00fb7a (diff)
embryo_cc - fix possible buffer overrun
fix CID 1039587
Diffstat (limited to 'src/bin/embryo')
-rw-r--r--src/bin/embryo/embryo_cc_sc2.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/bin/embryo/embryo_cc_sc2.c b/src/bin/embryo/embryo_cc_sc2.c
index 2da0656c2a..7f76febd79 100644
--- a/src/bin/embryo/embryo_cc_sc2.c
+++ b/src/bin/embryo/embryo_cc_sc2.c
@@ -1214,10 +1214,16 @@ command(void)
1214 char s2[20]; 1214 char s2[20];
1215 extern char *sc_tokens[]; /* forward declaration */ 1215 extern char *sc_tokens[]; /* forward declaration */
1216 1216
1217 if (tok < 256) 1217 if (tok < 256)
1218 sprintf(s2, "%c", (char)tok); 1218 {
1219 else 1219 s2[0] = (char)tok;
1220 strcpy(s2, sc_tokens[tok - tFIRST]); 1220 s2[1] = 0;
1221 }
1222 else
1223 {
1224 strncpy(s2, sc_tokens[tok - tFIRST], 19);
1225 s2[19] = 0;
1226 }
1221 error(1, sc_tokens[tSYMBOL - tFIRST], s2); 1227 error(1, sc_tokens[tSYMBOL - tFIRST], s2);
1222 break; 1228 break;
1223 } /* case */ 1229 } /* case */