47c47 < #define SAFE_RETURN { if (namebuf) efree(namebuf); if (filenamebuf) efree(filenamebuf); if (lbuf) efree(lbuf); return; } --- > #define SAFE_RETURN { if (namebuf) efree(namebuf); if (filenamebuf) efree(filenamebuf); if (lbuf) efree(lbuf); if (abuf) efree(abuf); return; } 57c57,58 < char *namebuf=NULL, *filenamebuf=NULL, *lbuf=NULL; --- > char *namebuf=NULL, *filenamebuf=NULL, *lbuf=NULL, *abuf=NULL; > char sbytes[16]; 107c108 < lbuf = emalloc(s-name + MAX(MAX(sizeof("_name"),sizeof("_size")),sizeof("_type"))); --- > lbuf = emalloc(s-name + MAX(MAX(sizeof("_name"),sizeof("_size")),sizeof("_type")) + 4); 128c129,137 < sprintf(lbuf, "%s_name", namebuf); --- > if (strstr(namebuf, "[]")) { > if (abuf) { > efree(abuf); > } > abuf = estrndup(namebuf, strlen(namebuf) - 2); > sprintf(lbuf, "%s_name[]", abuf); > } else { > sprintf(lbuf, "%s_name", namebuf); > } 131c140,141 < SET_VAR_STRING(lbuf, estrdup(s + 1)); --- > /* SET_VAR_STRING(lbuf, estrdup(s + 1)); */ > _php3_parse_gpc_data(estrdup(s + 1), lbuf, http_post_vars); 133c143,144 < SET_VAR_STRING(lbuf, estrdup(filenamebuf)); --- > /* SET_VAR_STRING(lbuf, estrdup(filenamebuf)); */ > _php3_parse_gpc_data(estrdup(filenamebuf), lbuf, http_post_vars); 139c150,154 < sprintf(lbuf, "%s_type", namebuf); --- > if (abuf) { > sprintf(lbuf, "%s_type[]", abuf); > } else { > sprintf(lbuf, "%s_type", namebuf); > } 211c226,227 < SET_VAR_STRING(namebuf, estrdup("none")); --- > /* SET_VAR_STRING(namebuf, estrdup("none")); */ > _php3_parse_gpc_data(estrdup("none"), namebuf, http_post_vars); 215c231,232 < SET_VAR_STRING(namebuf, estrdup("none")); --- > /* SET_VAR_STRING(namebuf, estrdup("none")); */ > _php3_parse_gpc_data(estrdup("none"), namebuf, http_post_vars); 218c235,236 < SET_VAR_STRING(namebuf, estrdup("none")); --- > /* SET_VAR_STRING(namebuf, estrdup("none")); */ > _php3_parse_gpc_data(estrdup("none"), namebuf, http_post_vars); 231c249,258 < SET_VAR_STRING(namebuf, estrdup(fn)); --- > /* SET_VAR_STRING(namebuf, estrdup(fn)); */ > _php3_parse_gpc_data(estrdup(fn), namebuf, http_post_vars); > } > > /* SET_VAR_LONG(lbuf, bytes); */ > > if (abuf) { > sprintf(lbuf, "%s_size[]", abuf); > } else { > sprintf(lbuf, "%s_size", namebuf); 233,234c260,263 < sprintf(lbuf, "%s_size", namebuf); < SET_VAR_LONG(lbuf, bytes); --- > memset(sbytes, 0, 16); > sprintf(sbytes, "%ld", bytes); > _php3_parse_gpc_data(estrdup(sbytes), lbuf, http_post_vars); >