+/*
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
#include "squid.h"
/* Find passwords ... */
/* We do it in a brute force way ... Cycle through all the possible passwords
if (((unsigned)password[i] <= ' ') || ((unsigned)password[i] > 127)) {
pwd_str[j] = '\\';
- sprintf(temp, "%03i", (int)password[i]);
+ snprintf(temp, sizeof(temp)-1, "%03i", (int)password[i]);
strcpy(&pwd_str[j + 1], temp);
j = j + 3; /* Space for \ accounted for below */
}
- sprintf(service_name, "\\\\%s\\%s", server, service); /* Could blow up */
+ sprintf(service_name, sizeof(service_name)-1, "\\\\%s\\%s", server, service); /* Could blow up */
/* Now loop through all password possibilities ... */
fprintf(stderr, "Passwords exhausted.");
}
+