| Server IP : 82.208.35.60 / Your IP : 216.73.216.89 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/security/kdbxviewer/files/ |
Upload File : |
--- src/main.c.orig 2022-09-06 17:00:52 UTC
+++ src/main.c
@@ -159,7 +159,7 @@ void print_key_table(cx9r_kt_group *g, int level) {
// Process commandline
int main(int argc, char **argv) {
- long unsigned int len = PATHLEN, opt, flags = 0;
+ size_t len = PATHLEN, opt, flags = 0;
char *kdbxfilename = malloc(len), *filename = malloc(len), command = 0,
*password = NULL, *self = argv[0] + strlen(argv[0]),
*configfilename = strcat(getenv("HOME"), CONFIGFILENAME);
@@ -246,14 +246,14 @@ int main(int argc, char **argv) {
*filename = 0;
if ((configfile = fopen(configfilename, "r")) != NULL)
while (getline(&filename, &len, configfile) != -1) {
- *(filename+strlen(filename)-1) = 0;
+ filename[strcspn(filename, "\n")] = '\0';
// Check the latest found file
- if ((kdbxfile = fopen(filename, "r")) != NULL) strcpy(kdbxfilename, filename);
+ if ((kdbxfile = fopen(filename, "r")) != NULL) kdbxfilename = strdup(filename);
*filename = 0;
}
if (*kdbxfilename == 0)
abort(-7, "No database specified on commandline or in configfile\n");
- else strcpy(filename, kdbxfilename);
+ else filename = strdup(kdbxfilename);
}
// Set default mode depending on search