#ifdef ELOG_TIMESTAMPS
strcpy(line, tprintf_timestamp());
#endif
- vsprintf(line + TIMESTAMP_SIZE, fmt, ap);
+ vsnprintf(line + TIMESTAMP_SIZE, ELOG_MAXLEN,
+ fmt, ap);
va_end(ap);
#ifdef USE_SYSLOG
#ifdef ELOG_TIMESTAMPS
strcpy(line, tprintf_timestamp());
#endif
- vsprintf(line+TIMESTAMP_SIZE, fmt, ap);
+ vsnprintf(line+TIMESTAMP_SIZE, ELOG_MAXLEN,
+ fmt, ap);
va_end(ap);
#ifdef USE_SYSLOG
#ifdef ELOG_TIMESTAMPS
strcpy(line, tprintf_timestamp());
#endif
- vsprintf(line + TIMESTAMP_SIZE, fmt, ap);
+ vsnprintf(line + TIMESTAMP_SIZE, ELOG_MAXLEN,
+ fmt, ap);
va_end(ap);
#ifdef USE_SYSLOG
return;
}
- sprintf(buffer, "%s/%s", DataDir, "pg_options");
+ snprintf(buffer, BUF_SIZE - 1,
+ "%s/%s", DataDir, "pg_options");
if ((fd = open(buffer, O_RDONLY)) < 0)
return;