aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--service/Dockerfile3
-rw-r--r--service/src/stlfile.c2
-rw-r--r--src/stlfile.c2
-rw-r--r--tests/data/evil1.stl2
4 files changed, 5 insertions, 4 deletions
diff --git a/service/Dockerfile b/service/Dockerfile
index c932e66..66952dc 100644
--- a/service/Dockerfile
+++ b/service/Dockerfile
@@ -1,6 +1,6 @@
FROM ubuntu:18.04
-RUN apt update && apt install -y --no-install-recommends socat build-essential
+RUN apt update && apt install -y --no-install-recommends socat gcc make libc6-dev libc6 libc-dev-bin
RUN addgroup --system service
RUN adduser --system --ingroup service --uid 1000 service
@@ -17,6 +17,7 @@ WORKDIR /service/
RUN make clean && make
EXPOSE 9000
+
ENV RESULTDIR=/data/uploads
ENTRYPOINT ["/entrypoint.sh"]
diff --git a/service/src/stlfile.c b/service/src/stlfile.c
index bddb24f..7c067f3 100644
--- a/service/src/stlfile.c
+++ b/service/src/stlfile.c
@@ -83,7 +83,7 @@ consume_arg(char **start, char **end)
if (!*start) return NULL;
for (c = *start; *c && !isws(*c); c++);
tmp = *start;
- *start = c + 1;
+ *start = c + (*c ? 1 : 0);
*end = c;
return tmp;
}
diff --git a/src/stlfile.c b/src/stlfile.c
index 17b97fc..c55a2a0 100644
--- a/src/stlfile.c
+++ b/src/stlfile.c
@@ -83,7 +83,7 @@ consume_arg(char **start, char **end)
if (!*start) return NULL;
for (c = *start; *c && !isws(*c); c++);
tmp = *start;
- *start = c + 1;
+ *start = c + (*c ? 1 : 0);
*end = c;
return tmp;
}
diff --git a/tests/data/evil1.stl b/tests/data/evil1.stl
index 706e9e2..ab1f340 100644
--- a/tests/data/evil1.stl
+++ b/tests/data/evil1.stl
@@ -1,5 +1,5 @@
solid test˙
-facet normal 0 0 1.0
+ facet normal 0 0 1.0
outer loop
vertex 1 0 0
vertex 1 1 0