File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6464/* Global functions */
6565static int handle_request (int status );
6666static void get_reply (void );
67+ static int process_key_option (const char * optarg , char * key ,
68+ unsigned int * keylen );
6769extern int delete_all_rules (int fd );
6870
6971/* Global vars */
@@ -785,8 +787,12 @@ static int opt_list(opt_handler_params_t *args)
785787 return OPT_ERROR_NO_REPLY ;
786788 }
787789 } else if (* (args -> count ) == 4 ) {
790+ int rc ;
791+
788792 if (args -> vars [optind ] && strcmp (args -> vars [optind ], "-k" ) == 0 ) {
789- strncat (key , args -> vars [3 ], keylen );
793+ rc = process_key_option (args -> vars [3 ], key , & keylen );
794+ if (rc )
795+ return rc ;
790796 * (args -> count ) -= 2 ;
791797 } else {
792798 audit_msg (LOG_ERR ,
@@ -1118,8 +1124,12 @@ static int opt_delete_all(opt_handler_params_t *args)
11181124 return OPT_ERROR_NO_REPLY ;
11191125 }
11201126 if (* (args -> count ) == 4 ) {
1127+ int rc ;
1128+
11211129 if (strcmp (args -> vars [optind ], "-k" ) == 0 ) {
1122- strncat (key , args -> vars [3 ], keylen );
1130+ rc = process_key_option (args -> vars [3 ], key , & keylen );
1131+ if (rc )
1132+ return rc ;
11231133 * (args -> count ) -= 2 ;
11241134 } else {
11251135 audit_msg (LOG_ERR ,
You can’t perform that action at this time.
0 commit comments