From e50a0b1b1d96d74e95ea332a237521cdafd8a257 Mon Sep 17 00:00:00 2001 From: roland Date: Thu, 25 Aug 2005 01:14:57 +0000 Subject: 2005-08-24 Roland McGrath * loc2c-runtime.h (deref_string): New macro. --- runtime/loc2c-runtime.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'runtime/loc2c-runtime.h') diff --git a/runtime/loc2c-runtime.h b/runtime/loc2c-runtime.h index ca26aa3b..aa6823fd 100644 --- a/runtime/loc2c-runtime.h +++ b/runtime/loc2c-runtime.h @@ -171,3 +171,10 @@ }) #endif + +#define deref_string(dst, addr, maxbytes) + ({ + if (__strncpy_from_user ((dst), (const char __user *) (addr), (maxbytes))) + goto deref_fault; + (dst); + }) -- cgit