projects
/
platform
/
core
/
api
/
system-info.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
894874f
)
tizenid: change rand() to rand_r( to fix the thread unsafe issue
43/78243/1
author
taeyoung
<ty317.kim@samsung.com>
Tue, 5 Jul 2016 00:58:32 +0000
(09:58 +0900)
committer
taeyoung
<ty317.kim@samsung.com>
Tue, 5 Jul 2016 00:58:32 +0000
(09:58 +0900)
Change-Id: I172b39587d12bb066fbdda43ba6084f78a68a3cd
Signed-off-by: taeyoung <ty317.kim@samsung.com>
src/tizenid/tizenid.c
patch
|
blob
|
history
diff --git
a/src/tizenid/tizenid.c
b/src/tizenid/tizenid.c
index
56fccd2
..
16382af
100755
(executable)
--- a/
src/tizenid/tizenid.c
+++ b/
src/tizenid/tizenid.c
@@
-49,15
+49,16
@@
static int get_pw_key(char *pw, unsigned int len)
{
int i, val, poolsize;
char *charpool = CHAR_POOL;
+ unsigned int seed;
if (!pw)
return -EINVAL;
poolsize = strlen(charpool);
- s
rand(time(NULL)
);
+ s
eed = time(NULL
);
for (i = 0 ; i < len ; i++) {
- val = rand
(
) % poolsize;
+ val = rand
_r(&seed
) % poolsize;
pw[i] = *(charpool + val);
}