From c55831a01dab548fdf9eccb7529396f6582c6637 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 13 Mar 2011 09:43:50 +0000 Subject: ext: ensure path is a valid C string Unlikely, but some app could pass '\0' into us --- ext/clogger_ext/clogger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/clogger_ext/clogger.c b/ext/clogger_ext/clogger.c index ad37d7d..1641f48 100644 --- a/ext/clogger_ext/clogger.c +++ b/ext/clogger_ext/clogger.c @@ -891,7 +891,7 @@ static VALUE to_path(VALUE self) struct stat sb; int rv; unsigned devfd; - const char *cpath = StringValuePtr(path); + const char *cpath = StringValueCStr(path); /* try to avoid an extra path lookup */ if (rb_respond_to(c->body, to_io_id)) -- cgit v1.2.3-24-ge0c7