| Server IP : 82.208.35.60 / Your IP : 216.73.217.33 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/sha1collisiondetection/files/ |
Upload File : |
--- src/main.c.orig 2017-03-27 16:11:23 UTC
+++ src/main.c
@@ -9,6 +9,8 @@
#include <stdlib.h>
#include <string.h>
#include <libgen.h>
+#include <limits.h> /* for NAME_MAX, max bytes in a file name */
+#include <assert.h> /* for assert() macro */
#include "sha1.h"
@@ -23,7 +25,9 @@ int main(int argc, char** argv)
if (argc < 2)
{
- printf("Usage: %s <file>\n", basename(argv[0]));
+assert (sizeof(buffer) >= NAME_MAX); /* reuse buffer[] for newly-POSIX-compliant, thread-safe basename() */
+ (void) strlcpy (buffer, argv[0], sizeof (buffer));
+ printf("Usage: %s <file>\n", basename(buffer));
return 1;
}