projects
/
platform
/
kernel
/
swap-modules.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c109235
)
[FIX] Add string saving exception handling (in PackArguments)
author
Dmitry Kovalenko
<d.kovalenko@samsung.com>
Tue, 14 May 2013 15:55:02 +0000
(19:55 +0400)
committer
Dmitry Kovalenko
<d.kovalenko@samsung.com>
Tue, 14 May 2013 15:55:02 +0000
(19:55 +0400)
driver/events.h
patch
|
blob
|
history
diff --git
a/driver/events.h
b/driver/events.h
index
b644ab7
..
0fc63d1
100644
(file)
--- a/
driver/events.h
+++ b/
driver/events.h
@@
-159,8
+159,12
@@
static char *PackArguments (char *pBuffer, unsigned long nLen, const char *szFor
if(strncpy_from_user(pResult,
user_s,
nLengthOfString) != (nLengthOfString-1)) {
+ const char err_str[] =
+ "(failed strcpy_from_user)";
EPRINTF("failed to copy string from user %p, bytes %d",
user_s, nLengthOfString);
+ nLengthOfString = sizeof(err_str);
+ memcpy(pResult, err_str, nLengthOfString);
}
}
else