Explorar o código

Ticket #47835 - Coverity: 12687..12692

Description: arg_max has to be always set.  But introduced by
commit 0a546bcb3d4625d6db1dcbb342922b4ddb3bee37

    Description: To solve "Passing string argv[0] of unknown size to
    slapi_ch_strdup, which expects a string of a particular size", get
    ARG_MAX and pass it to slapi_ch_strndup.
Noriko Hosoi %!s(int64=11) %!d(string=hai) anos
pai
achega
6e175e3308
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      ldap/servers/slapd/main.c

+ 1 - 1
ldap/servers/slapd/main.c

@@ -723,8 +723,8 @@ main( int argc, char **argv)
 
 #endif /* _WIN32 */
 
+	arg_max = sysconf(_SC_ARG_MAX);
 	if ( (myname = strrchr( argv[0], '/' )) == NULL ) {
-		arg_max = sysconf(_SC_ARG_MAX);
 		myname = slapi_ch_strndup( argv[0], arg_max );
 	} else {
 		myname = slapi_ch_strndup( myname + 1, arg_max );