summaryrefslogtreecommitdiff
path: root/src/glsl/pp/sl_pp_purify.c
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2009-06-13 13:50:45 +0200
committerMichal Krol <michal@vmware.com>2009-09-07 10:11:37 +0200
commit474f754282c06014fa0f687c08f4e97323166f83 (patch)
tree23dd6ff2c50cf344a14e7146cde466922f04e801 /src/glsl/pp/sl_pp_purify.c
parentaf617c603720cf41ec433f1653cc6dbdcffd8e31 (diff)
glsl: Raise an error on an unfinished comment block.
Diffstat (limited to 'src/glsl/pp/sl_pp_purify.c')
-rw-r--r--src/glsl/pp/sl_pp_purify.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/glsl/pp/sl_pp_purify.c b/src/glsl/pp/sl_pp_purify.c
index 7fbfc78d426..ded4dc8963b 100644
--- a/src/glsl/pp/sl_pp_purify.c
+++ b/src/glsl/pp/sl_pp_purify.c
@@ -152,6 +152,9 @@ _purify_comment(const char *input,
return eaten;
}
}
+ if (next == '\0') {
+ return 0;
+ }
}
}
}
@@ -171,8 +174,13 @@ sl_pp_purify(const char *input,
for (;;) {
char c;
+ unsigned int eaten;
- input += _purify_comment(input, &c);
+ eaten = _purify_comment(input, &c);
+ if (!eaten) {
+ return -1;
+ }
+ input += eaten;
if (out_len >= out_max) {
unsigned int new_max = out_max;