summaryrefslogtreecommitdiff
path: root/cleopatre/application/libspid
diff options
context:
space:
mode:
authorCyril Jourdan2011-11-29 17:13:49 +0100
committerCyril Jourdan2011-12-20 15:52:38 +0100
commit62f12ae27b92ece205760b2c868f15b21aa2ac40 (patch)
tree4e90e686c8953a464fbaf84a267841834f29f1d8 /cleopatre/application/libspid
parent35ff957f534cd2070dde11c46b46fbbeb819eda0 (diff)
cleo/devkit/tests/libspid: fix utests, refs #2772
Diffstat (limited to 'cleopatre/application/libspid')
-rw-r--r--cleopatre/application/libspid/src/config_line.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cleopatre/application/libspid/src/config_line.c b/cleopatre/application/libspid/src/config_line.c
index 712da0d319..e2e676f9e3 100644
--- a/cleopatre/application/libspid/src/config_line.c
+++ b/cleopatre/application/libspid/src/config_line.c
@@ -43,7 +43,7 @@
* \param delimiters string containing all accepted delimiters
* (usually space and tab characters)
* \param key key of the line to read; updated with the key of
- * the next line
+ * the next line; key buffer size must be LIBSPID_CONFIG_KEY_MAX_LEN
* \param elt_number maximum number of elements to read, updated
* with the real number of read elements if less is found
* \param elt array of pointers where are stored pointers to
@@ -202,7 +202,8 @@ libspid_error_t libspid_config_read_line(const char *filename, const char* delim
/* check if it is looked key */
if( (ptr == NULL) || (strlen(ptr) <= 0) || (*ptr == '#') )
continue;
- strcpy(key, ptr);
+ strncpy(key, ptr, (strlen(ptr) < LIBSPID_CONFIG_KEY_MAX_LEN) ?\
+ strlen(ptr) : LIBSPID_CONFIG_KEY_MAX_LEN);
break;
}