aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-07-03 13:34:16 +0200
committerPaul Kocialkowski <contact@paulk.fr>2014-07-03 13:34:16 +0200
commit960d41a9e018978d1622801def431990983774a4 (patch)
treeec47d509aacda595b84d2e6b40c8f4622c7ef31d
parentc9ec8b08b724e1e610d9099d5522f3a9aba3cf4e (diff)
downloadexternal_libsamsung-ipc-960d41a9e018978d1622801def431990983774a4.zip
external_libsamsung-ipc-960d41a9e018978d1622801def431990983774a4.tar.gz
external_libsamsung-ipc-960d41a9e018978d1622801def431990983774a4.tar.bz2
sec: Maximum password size is not so much the size of the size element
Kids, don't drink and codeā€¦ Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--samsung-ipc/sec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/samsung-ipc/sec.c b/samsung-ipc/sec.c
index ae23cb8..6ea645d 100644
--- a/samsung-ipc/sec.c
+++ b/samsung-ipc/sec.c
@@ -97,8 +97,8 @@ int ipc_sec_change_locking_pw_setup(struct ipc_sec_change_locking_pw_data *data,
if (password_old != NULL) {
password_old_length = strlen(password_old);
- if (password_old_length > sizeof(data->password_old_length))
- password_old_length = sizeof(data->password_old_length);
+ if (password_old_length > sizeof(data->password_old))
+ password_old_length = sizeof(data->password_old);
data->password_old_length = (unsigned char) password_old_length;
strncpy((char *) data->password_old, password_old, password_old_length);
@@ -108,8 +108,8 @@ int ipc_sec_change_locking_pw_setup(struct ipc_sec_change_locking_pw_data *data,
if (password_new != NULL) {
password_new_length = strlen(password_new);
- if (password_new_length > sizeof(data->password_new_length))
- password_new_length = sizeof(data->password_new_length);
+ if (password_new_length > sizeof(data->password_new))
+ password_new_length = sizeof(data->password_new);
data->password_new_length = (unsigned char) password_new_length;
strncpy((char *) data->password_new, password_new, password_new_length);