diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-14 23:51:11 (EST) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-14 23:51:11 (EST) |
commit | 46d22486379f050eab3fd9a8f850875162c5d65e (patch) | |
tree | 857fc36da35251799a6ef9ffa2650feef1002c13 | |
parent | 5d1f7db216c5cc3ea3357b4f8fc36308856cd135 (diff) |
opkg: use strdup() to prevent memory corruption
git-svn-id: http://opkg.googlecode.com/svn/trunk@38 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r-- | libopkg/opkg_state.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libopkg/opkg_state.c b/libopkg/opkg_state.c index 2cc8594..d83b96b 100644 --- a/libopkg/opkg_state.c +++ b/libopkg/opkg_state.c @@ -45,8 +45,7 @@ opkg_set_current_state (opkg_state_t state, const char *data) free (opkg_state_data); if (data) { - opkg_state_data = malloc (strlen (data)); - strcpy (opkg_state_data, data); + opkg_state_data = strdup (data); } else { |