aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2004-12-17 16:13:12 +0000
committerJason Woodward2004-12-17 16:13:12 +0000
commit72983c12852470cd2f7f6ad96961876de0896781 (patch)
tree5f70bdecfa644bf7f644a79f2f48f10054553154 /src
parentb7fac38d22f60d67124573ce8f7e06fa8b0f7c4e (diff)
downloadslapt-get-72983c12852470cd2f7f6ad96961876de0896781.tar.gz
produce warning is slack-require information is too long
Diffstat (limited to 'src')
-rw-r--r--src/package.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/package.c b/src/package.c
index b37c282..c34a352 100644
--- a/src/package.c
+++ b/src/package.c
@@ -270,7 +270,18 @@ struct pkg_list *parse_packages_txt(FILE *pkg_list_fh){
((char_pointer = strstr(getline_buffer,"PACKAGE REQUIRED")) != NULL)
){
size_t req_len = strlen("PACKAGE REQUIRED") + 2;
+ char *req_str = char_pointer + req_len;
getline_buffer[bytes_read - 1] = '\0';
+
+ if( strlen(req_str) > REQUIRED_LEN ){
+ fprintf( stderr, _("required too long [%s:%d]\n"),
+ req_str,
+ strlen(req_str)
+ );
+ free(tmp_pkg);
+ continue;
+ }
+
strncpy(tmp_pkg->required,char_pointer + req_len, strlen(char_pointer + req_len));
tmp_pkg->required[ strlen(char_pointer + req_len) ] = '\0';
}else{