mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Please avoid potential buffer overflows in new code. If you deal
with strings, consider storing the string length along with the string data. That will make your life easier.
This commit is contained in:
parent
a1510f90b0
commit
8476f5b29e
@ -206,21 +206,23 @@ static PHP_MSHUTDOWN_FUNCTION(dba)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
#include "ext/standard/php_smart_str.h"
|
||||
|
||||
static PHP_MINFO_FUNCTION(dba)
|
||||
{
|
||||
dba_handler *hptr;
|
||||
static char handlers[80], tmp[5];
|
||||
smart_str handlers = {0};
|
||||
|
||||
for(hptr = handler; hptr->name; hptr++) {
|
||||
sprintf(tmp, "%s ", hptr->name);
|
||||
strcat(handlers, tmp);
|
||||
smart_str_appends(&handlers, hptr->name);
|
||||
smart_str_appendc(&handlers, ' ');
|
||||
}
|
||||
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "DBA support", "enabled");
|
||||
php_info_print_table_row(2, "Supported handlers", handlers);
|
||||
php_info_print_table_row(2, "Supported handlers", handlers.c);
|
||||
php_info_print_table_end();
|
||||
smart_str_free(&handlers);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user