[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-06-22 Thread Pierre-Alain Joye
pajoye  Mon Jun 22 20:35:46 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - MF53: #48619, imap_search ALL segfaults
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.291r2=1.292diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.291 php-src/ext/imap/php_imap.c:1.292
--- php-src/ext/imap/php_imap.c:1.291   Sat Jun  6 02:40:13 2009
+++ php-src/ext/imap/php_imap.c Mon Jun 22 20:35:46 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.291 2009/06/06 02:40:13 mattwil Exp $ */
+/* $Id: php_imap.c,v 1.292 2009/06/22 20:35:46 pajoye Exp $ */
 
 #define IMAP41
 
@@ -3028,7 +3028,7 @@
 
slst = mail_sort(imap_le_struct-imap_stream, (argc == 6 ? charset : 
NIL), spg, mypgm, (argc = 4 ? flags : NIL));
 
-   if (spg) {
+   if (spg  !(flags  SE_FREE)) {
mail_free_searchpgm(spg);
}
 
@@ -4004,7 +4004,7 @@
 
mail_search_full(imap_le_struct-imap_stream, (argc == 4 ? charset : 
NIL), pgm, flags);
 
-   if (pgm) {
+   if (pgm  !(flags  SE_FREE)) {
mail_free_searchpgm(pgm);
}
 
@@ -4620,7 +4620,7 @@
 
pgm = mail_criteria(criteria);
top = mail_thread(imap_le_struct-imap_stream, REFERENCES, NIL, pgm, 
flags);
-   if (pgm) {
+   if (pgm  !(flags  SE_FREE)) {
mail_free_searchpgm(pgm);
}
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-05-20 Thread Kalle Sommer Nielsen
kalle   Wed May 20 08:22:38 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Nuke warnings (only in HEAD)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.289r2=1.290diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.289 php-src/ext/imap/php_imap.c:1.290
--- php-src/ext/imap/php_imap.c:1.289   Tue May  5 01:44:08 2009
+++ php-src/ext/imap/php_imap.c Wed May 20 08:22:38 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.289 2009/05/05 01:44:08 jani Exp $ */
+/* $Id: php_imap.c,v 1.290 2009/05/20 08:22:38 kalle Exp $ */
 
 #define IMAP41
 
@@ -3368,7 +3368,7 @@
 PHP_FUNCTION(imap_mail_compose)
 {
zval *envelope, *body;
-   char *key;
+   zstr key;
zval **data, **pvalue, **disp_data, **env_data;
ulong ind;
char *cookie = NIL;
@@ -3482,7 +3482,7 @@
while 
(zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) disp_data) == 
SUCCESS) {
disp_param = mail_newbody_parameter();

zend_hash_get_current_key(Z_ARRVAL_PP(pvalue), key, ind, 0);
-   disp_param-attribute = cpystr(key);
+   disp_param-attribute = cpystr(key.s);
convert_to_string_ex(disp_data);
disp_param-value = (char *) 
fs_get(Z_STRLEN_PP(disp_data) + 1);
memcpy(disp_param-value, 
Z_STRVAL_PP(disp_data), Z_STRLEN_PP(disp_data) + 1);
@@ -3516,7 +3516,7 @@
while 
(zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) disp_data) == 
SUCCESS) {
disp_param = mail_newbody_parameter();

zend_hash_get_current_key(Z_ARRVAL_PP(pvalue), key, ind, 0);
-   disp_param-attribute = cpystr(key);
+   disp_param-attribute = cpystr(key.s);
convert_to_string_ex(disp_data);
disp_param-value = (char *) 
fs_get(Z_STRLEN_PP(disp_data) + 1);
memcpy(disp_param-value, 
Z_STRVAL_PP(disp_data), Z_STRLEN_PP(disp_data) + 1);
@@ -3595,7 +3595,7 @@
while 
(zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) disp_data) == 
SUCCESS) {
disp_param = 
mail_newbody_parameter();

zend_hash_get_current_key(Z_ARRVAL_PP(pvalue), key, ind, 0);
-   disp_param-attribute = 
cpystr(key);
+   disp_param-attribute = 
cpystr(key.s);
convert_to_string_ex(disp_data);
disp_param-value = (char *) 
fs_get(Z_STRLEN_PP(disp_data) + 1);
memcpy(disp_param-value, 
Z_STRVAL_PP(disp_data), Z_STRLEN_PP(disp_data) + 1);
@@ -3629,7 +3629,7 @@
while 
(zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) disp_data) == 
SUCCESS) {
disp_param = 
mail_newbody_parameter();

zend_hash_get_current_key(Z_ARRVAL_PP(pvalue), key, ind, 0);
-   disp_param-attribute = 
cpystr(key);
+   disp_param-attribute = 
cpystr(key.s);
convert_to_string_ex(disp_data);
disp_param-value = (char *) 
fs_get(Z_STRLEN_PP(disp_data) + 1);
memcpy(disp_param-value, 
Z_STRVAL_PP(disp_data), Z_STRLEN_PP(disp_data) + 1);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-05-04 Thread Jani Taskinen
janiTue May  5 01:28:11 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - Fix the patch
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.287r2=1.288diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.287 php-src/ext/imap/php_imap.c:1.288
--- php-src/ext/imap/php_imap.c:1.287   Tue May  5 01:22:31 2009
+++ php-src/ext/imap/php_imap.c Tue May  5 01:28:10 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.287 2009/05/05 01:22:31 jani Exp $ */
+/* $Id: php_imap.c,v 1.288 2009/05/05 01:28:10 jani Exp $ */
 
 #define IMAP41
 
@@ -2942,7 +2942,6 @@
 {
php_imap_mutf7(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
 }
-#endif
 
 /* {{{ proto string imap_mutf7_to_utf8(string in)
Decode a modified UTF-7 string to UTF-8 */
@@ -2950,7 +2949,7 @@
 {
php_imap_mutf7(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
 }
-
+#endif
 
 /* {{{ proto bool imap_setflag_full(resource stream_id, string sequence, 
string flag [, int options])
Sets flags on messages */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c php_imap.h /ext/imap/tests imap_mutf7_to_utf8.phpt imap_utf8_to_mutf7_basic.phpt

2009-05-02 Thread Pierre-Alain Joye
pajoye  Sat May  2 17:32:36 2009 UTC

  Added files: 
/php-src/ext/imap/tests imap_mutf7_to_utf8.phpt 
imap_utf8_to_mutf7_basic.phpt 

  Modified files:  
/php-src/ext/imap   php_imap.c php_imap.h 
  Log:
  - [DOC] add imap_mutf7_to_utf8 and imap_utf8_to_mutf7
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.285r2=1.286diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.285 php-src/ext/imap/php_imap.c:1.286
--- php-src/ext/imap/php_imap.c:1.285   Thu Apr 30 18:57:50 2009
+++ php-src/ext/imap/php_imap.c Sat May  2 17:32:35 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.285 2009/04/30 18:57:50 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.286 2009/05/02 17:32:35 pajoye Exp $ */
 
 #define IMAP41
 
@@ -351,6 +351,14 @@
ZEND_ARG_INFO(0, buf)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_utf8_to_mutf7, 0, 0, 1)
+   ZEND_ARG_INFO(0, in)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mutf7_to_utf8, 0, 0, 1)
+   ZEND_ARG_INFO(0, in)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_setflag_full, 0, 0, 3)
ZEND_ARG_INFO(0, stream_id)
ZEND_ARG_INFO(0, sequence)
@@ -509,6 +517,8 @@
PHP_FE(imap_search, 
arginfo_imap_search)
PHP_FE(imap_utf7_decode,
arginfo_imap_utf7_decode)
PHP_FE(imap_utf7_encode,
arginfo_imap_utf7_encode)
+   PHP_FE(imap_utf8_to_mutf7,  
arginfo_imap_utf8_to_mutf7)
+   PHP_FE(imap_mutf7_to_utf8,  
arginfo_imap_mutf7_to_utf8)
PHP_FE(imap_mime_header_decode, 
arginfo_imap_mime_header_decode)
PHP_FE(imap_thread, 
arginfo_imap_thread)
PHP_FE(imap_timeout,
arginfo_imap_timeout)
@@ -2881,6 +2891,61 @@
 #undef B64
 #undef UNB64
 
+static void php_imap_mutf7(INTERNAL_FUNCTION_PARAMETERS, int mode)
+{
+   char *in;
+   int in_len;
+   unsigned char *out;
+
+   if (mode == 0) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, in, 
in_len, UG(utf8_conv)) == FAILURE) {
+   return;
+   }
+   
+   if (in_len  1) {
+   RETURN_EMPTY_STRING();
+   }
+
+   out = utf8_to_mutf7((unsigned char *) in);
+   } else {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, S, in, 
in_len) == FAILURE) {
+   return;
+   }
+
+   if (in_len  1) {
+   RETURN_EMPTY_UNICODE();
+   }
+
+   out = utf8_from_mutf7((unsigned char *) in);
+   }
+
+   if (out == NIL) {
+   RETURN_FALSE;
+   return;
+   }
+
+   if (mode == 0) {
+   RETURN_STRING((char *)out, 1);
+   } else {
+   RETURN_UTF8_STRING(out, ZSTR_DUPLICATE);
+   }
+}
+
+/* {{{ proto string imap_utf8_to_mutf7(string in)
+   Encode a UTF-8 string to modified UTF-7 */
+PHP_FUNCTION(imap_utf8_to_mutf7)
+{
+   php_imap_mutf7(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+
+/* {{{ proto string imap_mutf7_to_utf8(string in)
+   Decode a modified UTF-7 string to UTF-8 */
+PHP_FUNCTION(imap_mutf7_to_utf8)
+{
+   php_imap_mutf7(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
+
+
 /* {{{ proto bool imap_setflag_full(resource stream_id, string sequence, 
string flag [, int options])
Sets flags on messages */
 PHP_FUNCTION(imap_setflag_full)
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.h?r1=1.39r2=1.40diff_format=u
Index: php-src/ext/imap/php_imap.h
diff -u php-src/ext/imap/php_imap.h:1.39 php-src/ext/imap/php_imap.h:1.40
--- php-src/ext/imap/php_imap.h:1.39Tue Apr 28 08:23:32 2009
+++ php-src/ext/imap/php_imap.h Sat May  2 17:32:35 2009
@@ -27,7 +27,7 @@
+--+
  */
 
-/* $Id: php_imap.h,v 1.39 2009/04/28 08:23:32 pajoye Exp $ */
+/* $Id: php_imap.h,v 1.40 2009/05/02 17:32:35 pajoye Exp $ */
 
 #ifndef PHP_IMAP_H
 #define PHP_IMAP_H
@@ -165,6 +165,8 @@
 PHP_FUNCTION(imap_utf8);
 PHP_FUNCTION(imap_utf7_decode);
 PHP_FUNCTION(imap_utf7_encode);
+PHP_FUNCTION(imap_utf8_to_mutf7);
+PHP_FUNCTION(imap_mutf7_to_utf8);
 PHP_FUNCTION(imap_mime_header_decode);
 PHP_FUNCTION(imap_thread);
 PHP_FUNCTION(imap_timeout);

http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_mutf7_to_utf8.phpt?view=markuprev=1.1
Index: 

[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-04-30 Thread Pierre-Alain Joye
pajoye  Thu Apr 30 18:57:50 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - MFB: #47940, memory leaks in imap_body
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.284r2=1.285diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.284 php-src/ext/imap/php_imap.c:1.285
--- php-src/ext/imap/php_imap.c:1.284   Tue Apr 28 08:30:10 2009
+++ php-src/ext/imap/php_imap.c Thu Apr 30 18:57:50 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.284 2009/04/28 08:30:10 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.285 2009/04/30 18:57:50 pajoye Exp $ */
 
 #define IMAP41
 
@@ -850,7 +850,7 @@
REGISTER_LONG_CONSTANT(NIL, NIL, CONST_PERSISTENT | CONST_CS);
 
/* plug in our gets */
-   mail_parameters(NIL, SET_GETS, (void *) php_mail_gets);
+   mail_parameters(NIL, SET_GETS, (void *) NIL);
 
/* set default timeout values */
mail_parameters(NIL, SET_OPENTIMEOUT, (void *) 
FG(default_socket_timeout));
@@ -2326,7 +2326,9 @@
}
 
IMAPG(gets_stream) = writer;
+   mail_parameters(NIL, SET_GETS, (void *) php_mail_gets);
mail_fetchbody_full(imap_ptr-imap_stream, msgno, section, NULL, flags);
+   mail_parameters(NIL, SET_GETS, (void *) NIL);
IMAPG(gets_stream) = NULL;
 
if (close_stream) {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-04-28 Thread Pierre-Alain Joye
pajoye  Tue Apr 28 08:30:10 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - space to tabs
  - CS
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.283r2=1.284diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.283 php-src/ext/imap/php_imap.c:1.284
--- php-src/ext/imap/php_imap.c:1.283   Tue Apr 28 08:23:32 2009
+++ php-src/ext/imap/php_imap.c Tue Apr 28 08:30:10 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.283 2009/04/28 08:23:32 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.284 2009/04/28 08:30:10 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1526,11 +1526,11 @@
if (argc == 2) {
flags = options;
 
-/* Check that flags is exactly equal to PHP_EXPUNGE or zero */
-if (flags  ((flags  ~PHP_EXPUNGE) != 0)) {
-php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid 
value for the flags parameter);
- RETURN_FALSE;
-}
+   /* Check that flags is exactly equal to PHP_EXPUNGE or zero */
+   if (flags  ((flags  ~PHP_EXPUNGE) != 0)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid 
value for the flags parameter);
+   RETURN_FALSE;
+   }
 
/* Do the translation from PHP's internal PHP_EXPUNGE define to 
c-client's CL_EXPUNGE */
if (flags  PHP_EXPUNGE) {
@@ -1611,11 +1611,10 @@
return;
}
 
-if (flags  ((flags  ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
-php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
-RETURN_FALSE;
-}
-
+   if (flags  ((flags  ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+   RETURN_FALSE;
+   }
 
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
@@ -2214,10 +2213,10 @@
return;
}
 
-if (flags  ((flags  ~FT_UID) != 0)) {
-php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
-RETURN_FALSE;
-}
+   if (flags  ((flags  ~FT_UID) != 0)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+   RETURN_FALSE;
+   }
 
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
@@ -2264,11 +2263,10 @@
return;
}
 
-if (flags  ((flags  ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
-php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
-RETURN_FALSE;
-}
-
+   if (flags  ((flags  ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+   RETURN_FALSE;
+   }
 
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
@@ -2997,10 +2995,10 @@
return;
}
 
-if (flags  ((flags  ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) {
-php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
-RETURN_FALSE;
-}
+   if (flags  ((flags  ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+   RETURN_FALSE;
+   }
 
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-04-26 Thread Pierre-Alain Joye
pajoye  Sun Apr 26 23:44:46 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - rmeove duplicate definition
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.281r2=1.282diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.281 php-src/ext/imap/php_imap.c:1.282
--- php-src/ext/imap/php_imap.c:1.281   Sun Apr 26 09:43:39 2009
+++ php-src/ext/imap/php_imap.c Sun Apr 26 23:44:46 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.281 2009/04/26 09:43:39 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.282 2009/04/26 23:44:46 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1104,25 +1104,6 @@
 {
php_info_print_table_start();
php_info_print_table_row(2, IMAP c-Client Version, CCLIENTVERSION);
-#if HAVE_IMAP2007e
-   php_info_print_table_row(2, IMAP c-Client Version, 2007e);
-#elif HAVE_IMAP2007d
-   php_info_print_table_row(2, IMAP c-Client Version, 2007d);
-#elif HAVE_IMAP2007b
-   php_info_print_table_row(2, IMAP c-Client Version, 2007b);
-#elif HAVE_IMAP2007a
-   php_info_print_table_row(2, IMAP c-Client Version, 2007a);
-#elif HAVE_IMAP2004
-   php_info_print_table_row(2, IMAP c-Client Version, 2004);
-#elif HAVE_IMAP2001
-   php_info_print_table_row(2, IMAP c-Client Version, 2001);
-#elif HAVE_IMAP2000
-   php_info_print_table_row(2, IMAP c-Client Version, 2000);
-#elif defined(IMAP41)
-   php_info_print_table_row(2, IMAP c-Client Version, 4.1);
-#else
-   php_info_print_table_row(2, IMAP c-Client Version, 4.0);
-#endif
 #if HAVE_IMAP_SSL
php_info_print_table_row(2, SSL Support, enabled);
 #endif



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 11:21:41 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - bad idea to free body
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.273r2=1.274diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.273 php-src/ext/imap/php_imap.c:1.274
--- php-src/ext/imap/php_imap.c:1.273   Thu Apr 23 22:24:54 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 11:21:41 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.273 2009/04/23 22:24:54 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.274 2009/04/25 11:21:41 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1594,7 +1594,6 @@
} else {
RETVAL_STRINGL(body, body_len, 1);
}
-   free(body);
 }
 /* }}} */
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 14:53:50 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - silent warning, NULL is not 0
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.274r2=1.275diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.274 php-src/ext/imap/php_imap.c:1.275
--- php-src/ext/imap/php_imap.c:1.274   Sat Apr 25 11:21:41 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 14:53:50 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.274 2009/04/25 11:21:41 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.275 2009/04/25 14:53:50 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1191,7 +1191,7 @@
zval *streamind;
char *mailbox;
int mailbox_len;
-   long options = NULL, retries = NULL;
+   long options = 0, retries = 0;
pils *imap_le_struct; 
MAILSTREAM *imap_stream;
long flags=NIL;
@@ -1561,7 +1561,7 @@
pils *imap_le_struct; 
int msgindex, argc = ZEND_NUM_ARGS();
char *body;
-   unsigned long body_len;
+   unsigned long body_len = 0;
 
if (zend_parse_parameters(argc TSRMLS_CC, rl|l, streamind, msgno, 
flags) == FAILURE) {
return;
@@ -2845,7 +2845,7 @@
zval *streamind;
char *sequence, *flag;
int sequence_len, flag_len;
-   long flags = NULL;
+   long flags = 0;
pils *imap_le_struct;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rss|l, 
streamind, sequence, sequence_len, flag, flag_len, flags) == FAILURE) {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 15:02:04 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - SEARCHPGM struct has to be freed
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.275r2=1.276diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.275 php-src/ext/imap/php_imap.c:1.276
--- php-src/ext/imap/php_imap.c:1.275   Sat Apr 25 14:53:50 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 15:02:03 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.275 2009/04/25 14:53:50 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.276 2009/04/25 15:02:03 pajoye Exp $ */
 
 #define IMAP41
 
@@ -3892,6 +3892,7 @@
char *search_criteria;
MESSAGELIST *cur;
int argc = ZEND_NUM_ARGS();
+   SEARCHPGM *pgm = NIL;
 
if (zend_parse_parameters(argc TSRMLS_CC, rs|ls, streamind, 
criteria, criteria_len, flags, charset, charset_len) == FAILURE) {
return;
@@ -3902,7 +3903,14 @@
search_criteria = estrndup(criteria, criteria_len);

IMAPG(imap_messages) = IMAPG(imap_messages_tail) = NIL;
-   mail_search_full(imap_le_struct-imap_stream, (argc == 4 ? charset : 
NIL), mail_criteria(search_criteria), flags);
+   pgm = mail_criteria(search_criteria);
+
+   mail_search_full(imap_le_struct-imap_stream, (argc == 4 ? charset : 
NIL), pgm, flags);
+
+   if (pgm) {
+   mail_free_searchpgm(pgm);
+   }
+
if (IMAPG(imap_messages) == NIL) {
efree(search_criteria);
RETURN_FALSE;
@@ -4508,6 +4516,7 @@
char criteria[] = ALL;
THREADNODE *top;
int argc = ZEND_NUM_ARGS();
+   SEARCHPGM *pgm = NIL;
 
if (zend_parse_parameters(argc TSRMLS_CC, r|l, streamind, flags) == 
FAILURE) {
return;
@@ -4515,7 +4524,11 @@

ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);

-   top = mail_thread(imap_le_struct-imap_stream, REFERENCES, NIL, 
mail_criteria(criteria), flags);
+   pgm = mail_criteria(criteria);
+   top = mail_thread(imap_le_struct-imap_stream, REFERENCES, NIL, pgm, 
flags);
+   if (pgm) {
+   mail_free_searchpgm(pgm);
+   }
 
if(top == NIL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Function returned 
an empty tree);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 15:06:03 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - sync 5.3
  - add 2007d and 2007e
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.276r2=1.277diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.276 php-src/ext/imap/php_imap.c:1.277
--- php-src/ext/imap/php_imap.c:1.276   Sat Apr 25 15:02:03 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 15:06:03 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.276 2009/04/25 15:02:03 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.277 2009/04/25 15:06:03 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1077,7 +1077,11 @@
 /* }}} */
 
 #if !defined(CCLIENTVERSION)
-#if HAVE_IMAP2007b
+#if HAVE_IMAP2007e
+#define CCLIENTVERSION 2007e
+#if HAVE_IMAP2007e
+#define CCLIENTVERSION 2007d
+#if HAVE_IMAP2007d
 #define CCLIENTVERSION 2007b
 #elif HAVE_IMAP2007a
 #define CCLIENTVERSION 2007a
@@ -1100,6 +1104,25 @@
 {
php_info_print_table_start();
php_info_print_table_row(2, IMAP c-Client Version, CCLIENTVERSION);
+#if HAVE_IMAP2007e
+   php_info_print_table_row(2, IMAP c-Client Version, 2007e);
+#if HAVE_IMAP2007d
+   php_info_print_table_row(2, IMAP c-Client Version, 2007d);
+#if HAVE_IMAP2007b
+   php_info_print_table_row(2, IMAP c-Client Version, 2007b);
+#elif HAVE_IMAP2007a
+   php_info_print_table_row(2, IMAP c-Client Version, 2007a);
+#elif HAVE_IMAP2004
+   php_info_print_table_row(2, IMAP c-Client Version, 2004);
+#elif HAVE_IMAP2001
+   php_info_print_table_row(2, IMAP c-Client Version, 2001);
+#elif HAVE_IMAP2000
+   php_info_print_table_row(2, IMAP c-Client Version, 2000);
+#elif defined(IMAP41)
+   php_info_print_table_row(2, IMAP c-Client Version, 4.1);
+#else
+   php_info_print_table_row(2, IMAP c-Client Version, 4.0);
+#endif
 #if HAVE_IMAP_SSL
php_info_print_table_row(2, SSL Support, enabled);
 #endif



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 15:08:25 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - ws
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.277r2=1.278diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.277 php-src/ext/imap/php_imap.c:1.278
--- php-src/ext/imap/php_imap.c:1.277   Sat Apr 25 15:06:03 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 15:08:25 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.277 2009/04/25 15:06:03 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.278 2009/04/25 15:08:25 pajoye Exp $ */
 
 #define IMAP41
 
@@ -2198,7 +2198,6 @@
 RETURN_FALSE;
 }
 
-   
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
if (msgno  1) {
@@ -2977,13 +2976,11 @@
return;
}
 
-
 if (flags  ((flags  ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) {
 php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
 RETURN_FALSE;
 }
 
-   
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);

if ((argc == 3)  (flags  FT_UID)) {
@@ -3220,7 +3217,7 @@
return;
}
 
-   if (flags  ((flags  ~FT_UID) != 0)) {
+   if (flags  ((flags  ~FT_UID) != 0)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
RETURN_FALSE;
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 15:13:00 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - #elif
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.278r2=1.279diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.278 php-src/ext/imap/php_imap.c:1.279
--- php-src/ext/imap/php_imap.c:1.278   Sat Apr 25 15:08:25 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 15:13:00 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.278 2009/04/25 15:08:25 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.279 2009/04/25 15:13:00 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1079,9 +1079,9 @@
 #if !defined(CCLIENTVERSION)
 #if HAVE_IMAP2007e
 #define CCLIENTVERSION 2007e
-#if HAVE_IMAP2007e
+#elif HAVE_IMAP2007e
 #define CCLIENTVERSION 2007d
-#if HAVE_IMAP2007d
+#elif HAVE_IMAP2007b
 #define CCLIENTVERSION 2007b
 #elif HAVE_IMAP2007a
 #define CCLIENTVERSION 2007a
@@ -1106,9 +1106,9 @@
php_info_print_table_row(2, IMAP c-Client Version, CCLIENTVERSION);
 #if HAVE_IMAP2007e
php_info_print_table_row(2, IMAP c-Client Version, 2007e);
-#if HAVE_IMAP2007d
+#elif HAVE_IMAP2007d
php_info_print_table_row(2, IMAP c-Client Version, 2007d);
-#if HAVE_IMAP2007b
+#elif HAVE_IMAP2007b
php_info_print_table_row(2, IMAP c-Client Version, 2007b);
 #elif HAVE_IMAP2007a
php_info_print_table_row(2, IMAP c-Client Version, 2007a);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-04-25 Thread Pierre-Alain Joye
pajoye  Sat Apr 25 16:35:36 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - ws
  http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.279r2=1.280diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.279 php-src/ext/imap/php_imap.c:1.280
--- php-src/ext/imap/php_imap.c:1.279   Sat Apr 25 15:13:00 2009
+++ php-src/ext/imap/php_imap.c Sat Apr 25 16:35:36 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.279 2009/04/25 15:13:00 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.280 2009/04/25 16:35:36 pajoye Exp $ */
 
 #define IMAP41
 
@@ -598,7 +598,7 @@
 static int add_assoc_object(zval *arg, char *key, zval *tmp TSRMLS_DC)
 {
HashTable *symtable;
-   
+
if (Z_TYPE_P(arg) == IS_OBJECT) {
symtable = Z_OBJPROP_P(arg);
} else {
@@ -613,14 +613,14 @@
 static inline int add_next_index_object(zval *arg, zval *tmp TSRMLS_DC)
 {
HashTable *symtable;
-   
+
if (Z_TYPE_P(arg) == IS_OBJECT) {
symtable = Z_OBJPROP_P(arg);
} else {
symtable = Z_ARRVAL_P(arg);
}
 
-   return zend_hash_next_index_insert(symtable, (void *) tmp, sizeof(zval 
*), NULL); 
+   return zend_hash_next_index_insert(symtable, (void *) tmp, sizeof(zval 
*), NULL);
 }
 /* }}} */
 
@@ -691,7 +691,7 @@
 /* }}} */
 
 /* {{{ mail_newmessagelist
- * 
+ *
  * Mail instantiate MESSAGELIST
  * Returns: new MESSAGELIST list
  * Author: CJH
@@ -722,8 +722,8 @@
 }
 /* }}} */
 
-#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) 
-/* {{{ mail_getquota 
+#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
+/* {{{ mail_getquota
  *
  * Mail GET_QUOTA callback
  * Called via the mail_parameter function in c-client:src/c-client/mail.c
@@ -734,7 +734,7 @@
 {
zval *t_map, *return_value;
TSRMLS_FETCH();
-   
+
return_value = *IMAPG(quota_return);
 
 /* put parsing code here */
@@ -829,7 +829,7 @@
 
 #ifndef PHP_WIN32
auth_link(auth_log);   /* link in the log authenticator */
-   auth_link(auth_md5);   /* link in the cram-md5 authenticator */ 
+   auth_link(auth_md5);   /* link in the cram-md5 authenticator */
 #if HAVE_IMAP_KRB  defined(HAVE_IMAP_AUTH_GSS)
auth_link(auth_gss);   /* link in the gss authenticator */
 #endif
@@ -879,13 +879,13 @@
REGISTER_LONG_CONSTANT(OP_SECURE, OP_SECURE, CONST_PERSISTENT | 
CONST_CS);
/* don't do non-secure authentication */
 
-   /* 
+   /*
PHP re-assigns CL_EXPUNGE a custom value that can be used as part of 
the imap_open() bitfield
-   because it seems like a good idea to be able to indicate that the 
mailbox should be 
+   because it seems like a good idea to be able to indicate that the 
mailbox should be
automatically expunged during imap_open in case the script get 
interrupted and it doesn't get
to the imap_close() where this option is normally placed.  If the 
c-client library adds other
-   options and the value for this one conflicts, simply make PHP_EXPUNGE 
higher at the top of 
-   this file 
+   options and the value for this one conflicts, simply make PHP_EXPUNGE 
higher at the top of
+   this file
*/
REGISTER_LONG_CONSTANT(CL_EXPUNGE, PHP_EXPUNGE, CONST_PERSISTENT | 
CONST_CS);
/* expunge silently */
@@ -1143,8 +1143,8 @@
MAILSTREAM *imap_stream;
pils *imap_le_struct;
int argc = ZEND_NUM_ARGS();
-   
-   if (zend_parse_parameters(argc TSRMLS_CC, sss|ll, mailbox, 
mailbox_len, user, user_len, 
+
+   if (zend_parse_parameters(argc TSRMLS_CC, sss|ll, mailbox, 
mailbox_len, user, user_len,
passwd, passwd_len, flags, retries) == FAILURE) {
return;
}
@@ -1156,11 +1156,11 @@
}
}
 
-   if (IMAPG(imap_user)) { 
+   if (IMAPG(imap_user)) {
efree(IMAPG(imap_user));
}
 
-   if (IMAPG(imap_password)) { 
+   if (IMAPG(imap_password)) {
efree(IMAPG(imap_password));
}
 
@@ -1193,7 +1193,7 @@
 
imap_le_struct = emalloc(sizeof(pils));
imap_le_struct-imap_stream = imap_stream;
-   imap_le_struct-flags = cl_flags;   
+   imap_le_struct-flags = cl_flags;
 
ZEND_REGISTER_RESOURCE(return_value, imap_le_struct, le_imap);
 }
@@ -1215,7 +1215,7 @@
char *mailbox;
int mailbox_len;
long options = 0, retries = 0;
-   pils *imap_le_struct; 
+   pils *imap_le_struct;
MAILSTREAM *imap_stream;
long flags=NIL;
long cl_flags=NIL;
@@ -1232,7 +1232,7 @@
cl_flags = CL_EXPUNGE;
flags ^= PHP_EXPUNGE;
}
-   

[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-04-23 Thread Pierre-Alain Joye
pajoye  Thu Apr 23 22:24:54 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - #47940,  leaks in imap_body()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.272r2=1.273diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.272 php-src/ext/imap/php_imap.c:1.273
--- php-src/ext/imap/php_imap.c:1.272   Tue Mar 10 23:39:22 2009
+++ php-src/ext/imap/php_imap.c Thu Apr 23 22:24:54 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.272 2009/03/10 23:39:22 helly Exp $ */
+/* $Id: php_imap.c,v 1.273 2009/04/23 22:24:54 pajoye Exp $ */
 
 #define IMAP41
 
@@ -1560,6 +1560,8 @@
long msgno, flags = 0;
pils *imap_le_struct; 
int msgindex, argc = ZEND_NUM_ARGS();
+   char *body;
+   unsigned long body_len;
 
if (zend_parse_parameters(argc TSRMLS_CC, rl|l, streamind, msgno, 
flags) == FAILURE) {
return;
@@ -1586,7 +1588,13 @@
RETURN_FALSE;
}
 
-   RETVAL_STRING(mail_fetchtext_full(imap_le_struct-imap_stream, msgno, 
NIL, (argc == 3 ? flags : NIL)), 1);
+   body = mail_fetchtext_full (imap_le_struct-imap_stream, msgno, 
body_len, (argc == 3 ? flags : NIL));
+   if (body_len == 0) {
+   RETVAL_EMPTY_STRING();
+   } else {
+   RETVAL_STRINGL(body, body_len, 1);
+   }
+   free(body);
 }
 /* }}} */
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-01-08 Thread Ilia Alshanetsky
iliaa   Thu Jan  8 16:15:45 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  
  MFB: Improved parameter fixing  address a compiler warning
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.270r2=1.271diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.270 php-src/ext/imap/php_imap.c:1.271
--- php-src/ext/imap/php_imap.c:1.270   Wed Jan  7 18:25:50 2009
+++ php-src/ext/imap/php_imap.c Thu Jan  8 16:15:45 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.270 2009/01/07 18:25:50 felipe Exp $ */
+/* $Id: php_imap.c,v 1.271 2009/01/08 16:15:45 iliaa Exp $ */
 
 #define IMAP41
 
@@ -1191,20 +1191,19 @@
zval *streamind;
char *mailbox;
int mailbox_len;
-   long options, retries;
+   long options = NULL, retries = NULL;
pils *imap_le_struct; 
MAILSTREAM *imap_stream;
long flags=NIL;
long cl_flags=NIL;
-   int argc = ZEND_NUM_ARGS();
 
-   if (zend_parse_parameters(argc TSRMLS_CC, rs|ll, streamind, 
mailbox, mailbox_len, options, retries) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs|ll, 
streamind, mailbox, mailbox_len, options, retries) == FAILURE) {
return;
}
 
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
-   if (argc = 3) {
+   if (options) {
flags = options;
if (flags  PHP_EXPUNGE) {
cl_flags = CL_EXPUNGE;
@@ -1213,7 +1212,7 @@
imap_le_struct-flags = cl_flags;   
}
 #ifdef SET_MAXLOGINTRIALS
-   if (argc == 4) {
+   if (retries) {
mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) retries);
}
 #endif
@@ -1241,9 +1240,8 @@
int folder_len, message_len, flags_len = 0;
pils *imap_le_struct;
STRING st;
-   int argc = ZEND_NUM_ARGS();
 
-   if (zend_parse_parameters(argc TSRMLS_CC, rss|s, streamind, folder, 
folder_len, message, message_len, flags, flags_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rss|s, 
streamind, folder, folder_len, message, message_len, flags, flags_len) 
== FAILURE) {
return;
}
   
@@ -1251,7 +1249,7 @@
 
INIT (st, mail_string, (void *) message, message_len);
 
-   if (mail_append_full(imap_le_struct-imap_stream, folder, (argc == 4 ? 
flags : NIL), NIL, st)) {
+   if (mail_append_full(imap_le_struct-imap_stream, folder, (flags ? 
flags : NIL), NIL, st)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -2840,17 +2838,16 @@
zval *streamind;
char *sequence, *flag;
int sequence_len, flag_len;
-   long flags;
+   long flags = NULL;
pils *imap_le_struct;
-   int argc = ZEND_NUM_ARGS();
 
-   if (zend_parse_parameters(argc TSRMLS_CC, rss|l, streamind, 
sequence, sequence_len, flag, flag_len, flags) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rss|l, 
streamind, sequence, sequence_len, flag, flag_len, flags) == FAILURE) {
return;
}
 
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
-   mail_setflag_full(imap_le_struct-imap_stream, sequence, flag, (argc == 
4 ? flags : NIL));
+   mail_setflag_full(imap_le_struct-imap_stream, sequence, flag, (flags ? 
flags : NIL));
RETURN_TRUE;
 }
 /* }}} */
@@ -4093,34 +4090,6 @@
 }
 /* }}} */
 
-/* {{{ _php_rfc822_len
- * Calculate string length based on imap's rfc822_cat function.
- */
-static int _php_rfc822_len(char *str)
-{
-   int len;
-   char *p;
-
-   if (!str || !*str) {
-   return 0;
-   }
-
-   /* strings with special characters will need to be quoted, as a safety 
measure we
-* add 2 bytes for the quotes just in case.
-*/
-   len = strlen(str) + 2;
-   p = str;
-   /* rfc822_cat() will escape all  and \ characters, therefor we need to 
increase
-* our buffer length to account for these characters.
-*/
-   while ((p = strpbrk(p, \\\))) {
-   p++;
-   len++;
-   }
-
-   return len;
-}
-/* }}} */
 
 /* Support Functions */
 
@@ -4160,6 +4129,35 @@
 
 #else
 
+/* {{{ _php_rfc822_len
+ * Calculate string length based on imap's rfc822_cat function.
+ */
+static int _php_rfc822_len(char *str)
+{
+   int len;
+   char *p;
+
+   if (!str || !*str) {
+   return 0;
+   }
+
+   /* strings with special characters will need to be quoted, as a safety 
measure we
+* add 2 bytes for the quotes just in case.
+*/
+   len = strlen(str) + 2;
+   p = str;
+   /* rfc822_cat() will 

[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2009-01-07 Thread Felipe Pena
felipe  Wed Jan  7 18:25:50 2009 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - Fixed duplicate errmsg
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.269r2=1.270diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.269 php-src/ext/imap/php_imap.c:1.270
--- php-src/ext/imap/php_imap.c:1.269   Wed Dec 31 11:12:32 2008
+++ php-src/ext/imap/php_imap.c Wed Jan  7 18:25:50 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.269 2008/12/31 11:12:32 sebastian Exp $ */
+/* $Id: php_imap.c,v 1.270 2009/01/07 18:25:50 felipe Exp $ */
 
 #define IMAP41
 
@@ -1199,7 +1199,7 @@
int argc = ZEND_NUM_ARGS();
 
if (zend_parse_parameters(argc TSRMLS_CC, rs|ll, streamind, 
mailbox, mailbox_len, options, retries) == FAILURE) {
-   ZEND_WRONG_PARAM_COUNT();
+   return;
}
 
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-12-24 Thread Felipe Pena
felipe  Wed Dec 24 13:30:49 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - Fixed memory leak in imap_rfc822_parse_adrlist
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.267r2=1.268diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.267 php-src/ext/imap/php_imap.c:1.268
--- php-src/ext/imap/php_imap.c:1.267   Tue Dec 16 21:34:16 2008
+++ php-src/ext/imap/php_imap.c Wed Dec 24 13:30:49 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.267 2008/12/16 21:34:16 zoe Exp $ */
+/* $Id: php_imap.c,v 1.268 2008/12/24 13:30:49 felipe Exp $ */
 
 #define IMAP41
 
@@ -2512,6 +2512,8 @@
}
add_next_index_object(return_value, tovals TSRMLS_CC);
} while ((addresstmp = addresstmp-next));
+   
+   mail_free_envelope(env);
 }
 /* }}} */
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-12-16 Thread Zoe Slattery
zoe Tue Dec 16 21:08:50 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  bug #46884 fix
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.265r2=1.266diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.265 php-src/ext/imap/php_imap.c:1.266
--- php-src/ext/imap/php_imap.c:1.265   Fri Dec  5 11:57:24 2008
+++ php-src/ext/imap/php_imap.c Tue Dec 16 21:08:50 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.265 2008/12/05 11:57:24 zoe Exp $ */
+/* $Id: php_imap.c,v 1.266 2008/12/16 21:08:50 zoe Exp $ */
 
 #define IMAP41
 
@@ -1560,6 +1560,12 @@
return;
}
 
+if (flags  ((flags  ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
+php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+RETURN_FALSE;
+}
+
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
if ((argc == 3)  (flags  FT_UID)) {
@@ -2151,6 +2157,12 @@
if (zend_parse_parameters(argc TSRMLS_CC, rl|l, streamind, msgno, 
flags) == FAILURE) {
return;
}
+
+if (flags  ((flags  ~FT_UID) != 0)) {
+php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+RETURN_FALSE;
+}
+

ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
@@ -2197,6 +2209,12 @@
return;
}
 
+if (flags  ((flags  ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
+php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+RETURN_FALSE;
+}
+
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
if (argc  4 || !(flags  FT_UID)) {
@@ -2915,13 +2933,20 @@
 PHP_FUNCTION(imap_fetchheader)
 {
zval *streamind;
-   long msgno, flags;
+   long msgno, flags=0L;
pils *imap_le_struct;
int msgindex, argc = ZEND_NUM_ARGS();

if (zend_parse_parameters(argc TSRMLS_CC, rl|l, streamind, msgno, 
flags) == FAILURE) {
return;
}
+
+
+if (flags  ((flags  ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) {
+php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+RETURN_FALSE;
+}
+

ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);

@@ -3159,7 +3184,7 @@
return;
}
 
-   if (flags  ((flags  ~FT_UID) !=0)) { 
+   if (flags  ((flags  ~FT_UID) != 0)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
RETURN_FALSE;
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-12-16 Thread Zoe Slattery
zoe Tue Dec 16 21:34:16 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  bug #46837 fix
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.266r2=1.267diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.266 php-src/ext/imap/php_imap.c:1.267
--- php-src/ext/imap/php_imap.c:1.266   Tue Dec 16 21:08:50 2008
+++ php-src/ext/imap/php_imap.c Tue Dec 16 21:34:16 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.266 2008/12/16 21:08:50 zoe Exp $ */
+/* $Id: php_imap.c,v 1.267 2008/12/16 21:34:16 zoe Exp $ */
 
 #define IMAP41
 
@@ -1483,6 +1483,13 @@
 
if (argc == 2) {
flags = options;
+
+/* Check that flags is exactly equal to PHP_EXPUNGE or zero */
+if (flags  ((flags  ~PHP_EXPUNGE) != 0)) {
+php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid 
value for the flags parameter);
+ RETURN_FALSE;
+}
+
/* Do the translation from PHP's internal PHP_EXPUNGE define to 
c-client's CL_EXPUNGE */
if (flags  PHP_EXPUNGE) {
flags ^= PHP_EXPUNGE;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-12-05 Thread Zoe Slattery
zoe Fri Dec  5 11:57:24 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  bug #46731 modification to previous fix
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.264r2=1.265diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.264 php-src/ext/imap/php_imap.c:1.265
--- php-src/ext/imap/php_imap.c:1.264   Wed Dec  3 01:04:33 2008
+++ php-src/ext/imap/php_imap.c Fri Dec  5 11:57:24 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.264 2008/12/03 01:04:33 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.265 2008/12/05 11:57:24 zoe Exp $ */
 
 #define IMAP41
 
@@ -3159,7 +3159,7 @@
return;
}
 
-   if (flags  !(flags  FT_UID)) {
+   if (flags  ((flags  ~FT_UID) !=0)) { 
php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
RETURN_FALSE;
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-12-02 Thread Ilia Alshanetsky
iliaa   Wed Dec  3 01:04:34 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  
  MFB: Fixed bug #46731 (Missing validation for the options parameter of the
 
imap_fetch_overview() function).
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.263r2=1.264diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.263 php-src/ext/imap/php_imap.c:1.264
--- php-src/ext/imap/php_imap.c:1.263   Mon Nov 17 11:26:21 2008
+++ php-src/ext/imap/php_imap.c Wed Dec  3 01:04:33 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.263 2008/11/17 11:26:21 felipe Exp $ */
+/* $Id: php_imap.c,v 1.264 2008/12/03 01:04:33 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3159,11 +3159,16 @@
return;
}
 
+   if (flags  !(flags  FT_UID)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, invalid value for 
the options parameter);
+   RETURN_FALSE;
+   }
+
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
array_init(return_value);
-   
-   status = (flags  FT_UID) 
+
+   status = (flags  FT_UID)
? mail_uid_sequence(imap_le_struct-imap_stream, sequence)
: mail_sequence(imap_le_struct-imap_stream, sequence);




-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-10-05 Thread Ilia Alshanetsky
iliaa   Mon Oct  6 01:19:08 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  
  MFB: Fixed a few signedness warnings
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.258r2=1.259diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.258 php-src/ext/imap/php_imap.c:1.259
--- php-src/ext/imap/php_imap.c:1.258   Mon Aug  4 21:13:33 2008
+++ php-src/ext/imap/php_imap.c Mon Oct  6 01:19:07 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.258 2008/08/04 21:13:33 jani Exp $ */
+/* $Id: php_imap.c,v 1.259 2008/10/06 01:19:07 iliaa Exp $ */
 
 #define IMAP41
 
@@ -2738,7 +2738,7 @@
 #if PHP_DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, outp - out [%d] != 
outlen [%d], outp - out, outlen);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, outp - out [%ld] 
!= outlen [%d], outp - out, outlen);
}
 #endif
 
@@ -2855,7 +2855,7 @@
 #if PHP_DEBUG
/* warn if we computed outlen incorrectly */
if (outp - out != outlen) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, outp - out [%d] != 
outlen [%d], outp - out, outlen);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, outp - out [%ld] 
!= outlen [%d], outp - out, outlen);
}
 #endif
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-07-11 Thread Felipe Pena
felipe  Fri Jul 11 11:29:41 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: - Fixed the strings size in imap_headerinfo
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.255r2=1.256diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.255 php-src/ext/imap/php_imap.c:1.256
--- php-src/ext/imap/php_imap.c:1.255   Thu Jul 10 17:54:08 2008
+++ php-src/ext/imap/php_imap.c Fri Jul 11 11:29:41 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.255 2008/07/10 17:54:08 felipe Exp $ */
+/* $Id: php_imap.c,v 1.256 2008/07/11 11:29:41 felipe Exp $ */
 
 #define IMAP41
 
@@ -1995,7 +1995,7 @@
pils *imap_le_struct;
MESSAGECACHE *cache;
ENVELOPE *en;
-   char dummy[2000], fulladdress[MAILTMPLEN];
+   char dummy[2000], fulladdress[MAILTMPLEN + 1];
int myargc = ZEND_NUM_ARGS();

if (myargc  2 || myargc  5 || zend_get_parameters_ex(myargc, 
streamind, msgno, fromlength, subjectlength, defaulthost) == FAILURE) {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-07-10 Thread Felipe Pena
felipe  Thu Jul 10 17:54:09 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - MFB: Fixed bug #45460 (imap patch for fromlength fix in imap_headerinfo 
doesn't accept lengths of 1024)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.254r2=1.255diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.254 php-src/ext/imap/php_imap.c:1.255
--- php-src/ext/imap/php_imap.c:1.254   Mon Jul  7 17:19:07 2008
+++ php-src/ext/imap/php_imap.c Thu Jul 10 17:54:08 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.254 2008/07/07 17:19:07 felipe Exp $ */
+/* $Id: php_imap.c,v 1.255 2008/07/10 17:54:08 felipe Exp $ */
 
 #define IMAP41
 
@@ -2007,8 +2007,8 @@
convert_to_long_ex(msgno);
if (myargc = 3) {
convert_to_long_ex(fromlength);
-   if (Z_LVAL_PP(fromlength)  0 || Z_LVAL_PP(fromlength) = 
MAILTMPLEN) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, From 
length has to be between 1 and %i, MAILTMPLEN);
+   if (Z_LVAL_PP(fromlength)  0 || Z_LVAL_PP(fromlength)  
MAILTMPLEN) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, From 
length has to be between 0 and %d, MAILTMPLEN);
RETURN_FALSE;
}
} else {
@@ -2016,8 +2016,8 @@
}
if (myargc = 4) {
convert_to_long_ex(subjectlength);
-   if (Z_LVAL_PP(subjectlength)  0 || Z_LVAL_PP(subjectlength) = 
MAILTMPLEN) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Subject 
length has to be between 1 and %i, MAILTMPLEN);
+   if (Z_LVAL_PP(subjectlength)  0 || Z_LVAL_PP(subjectlength)  
MAILTMPLEN) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Subject 
length has to be between 0 and %d, MAILTMPLEN);
RETURN_FALSE;
}
} else {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-07-07 Thread Felipe Pena
felipe  Mon Jul  7 17:19:07 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - MFB: Added arginfo
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.253r2=1.254diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.253 php-src/ext/imap/php_imap.c:1.254
--- php-src/ext/imap/php_imap.c:1.253   Thu Jul  3 18:28:41 2008
+++ php-src/ext/imap/php_imap.c Mon Jul  7 17:19:07 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.253 2008/07/03 18:28:41 pajoye Exp $ */
+/* $Id: php_imap.c,v 1.254 2008/07/07 17:19:07 felipe Exp $ */
 
 #define IMAP41
 
@@ -96,84 +96,498 @@
 ZEND_DECLARE_MODULE_GLOBALS(imap)
 static PHP_GINIT_FUNCTION(imap);
 
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_open, 0, 0, 3)
+   ZEND_ARG_INFO(0, mailbox)
+   ZEND_ARG_INFO(0, user)
+   ZEND_ARG_INFO(0, password)
+   ZEND_ARG_INFO(0, options)
+   ZEND_ARG_INFO(0, n_retries)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_reopen, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mailbox)
+   ZEND_ARG_INFO(0, options)
+   ZEND_ARG_INFO(0, n_retries)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_append, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, folder)
+   ZEND_ARG_INFO(0, message)
+   ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_num_msg, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_ping, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_num_recent, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+ZEND_END_ARG_INFO()
+
+#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_get_quota, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, qroot)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_get_quotaroot, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mbox)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_set_quota, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, qroot)
+   ZEND_ARG_INFO(0, mailbox_size)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_setacl, 0, 0, 4)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mailbox)
+   ZEND_ARG_INFO(0, id)
+   ZEND_ARG_INFO(0, rights)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_getacl, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mailbox)
+ZEND_END_ARG_INFO()
+#endif
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_expunge, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_close, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_headers, 0, 0, 1)
+   ZEND_ARG_INFO(0, stream_id)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_body, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, msg_no)
+   ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mail_copy, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, msglist)
+   ZEND_ARG_INFO(0, mailbox)
+   ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mail_move, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, sequence)
+   ZEND_ARG_INFO(0, mailbox)
+   ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_createmailbox, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mailbox)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_renamemailbox, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, old_name)
+   ZEND_ARG_INFO(0, new_name)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_deletemailbox, 0, 0, 2)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, mailbox)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_list, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, ref)
+   ZEND_ARG_INFO(0, pattern)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_getmailboxes, 0, 0, 3)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, ref)
+   ZEND_ARG_INFO(0, pattern)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_listscan, 0, 0, 4)
+   ZEND_ARG_INFO(0, stream_id)
+   ZEND_ARG_INFO(0, ref)
+   

[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-06-10 Thread Philip Olson
philip  Wed Jun 11 02:29:39 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  fixed imap_listscan() proto
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.251r2=1.252diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.251 php-src/ext/imap/php_imap.c:1.252
--- php-src/ext/imap/php_imap.c:1.251   Thu May  8 12:00:36 2008
+++ php-src/ext/imap/php_imap.c Wed Jun 11 02:29:39 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.251 2008/05/08 12:00:36 felipe Exp $ */
+/* $Id: php_imap.c,v 1.252 2008/06/11 02:29:39 philip Exp $ */
 
 #define IMAP41
 
@@ -1453,7 +1453,7 @@
 }
 /* }}} */
 
-/* {{{ proto array imap_scan(resource stream_id, string ref, string pattern, 
string content)
+/* {{{ proto array imap_listscan(resource stream_id, string ref, string 
pattern, string content)
Read list of mailboxes containing a certain string */
 PHP_FUNCTION(imap_listscan)
 {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-05-08 Thread Felipe Pena
felipe  Thu May  8 12:00:36 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - Fixed double free
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.250r2=1.251diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.250 php-src/ext/imap/php_imap.c:1.251
--- php-src/ext/imap/php_imap.c:1.250   Thu Apr 17 11:08:32 2008
+++ php-src/ext/imap/php_imap.c Thu May  8 12:00:36 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.250 2008/04/17 11:08:32 felipe Exp $ */
+/* $Id: php_imap.c,v 1.251 2008/05/08 12:00:36 felipe Exp $ */
 
 #define IMAP41
 
@@ -,9 +,6 @@
if (dest.data) {
free(dest.data);
}
-   if (src.data) {
-   free(src.data);
-   }
if (src.data  src.data != dest.data) {
free(src.data);
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-04-17 Thread Felipe Pena
felipe  Thu Apr 17 11:08:32 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - Fixed typo
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.249r2=1.250diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.249 php-src/ext/imap/php_imap.c:1.250
--- php-src/ext/imap/php_imap.c:1.249   Tue Apr  8 00:02:01 2008
+++ php-src/ext/imap/php_imap.c Thu Apr 17 11:08:32 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.249 2008/04/08 00:02:01 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.250 2008/04/17 11:08:32 felipe Exp $ */
 
 #define IMAP41
 
@@ -796,7 +796,7 @@
 #ifdef SET_MAXLOGINTRIALS
if (myargc == 5) {
convert_to_long_ex(retries);
-   if (retries  0) {
+   if (Z_LVAL_PP(retries)  0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING ,Retries 
must be greater or equal to 0);
} else {
mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-04-07 Thread Ilia Alshanetsky
iliaa   Tue Apr  8 00:02:01 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  
  MFB: Fixed bug #44663 (Crash in imap_mail_compose if body parameter
  invalid)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.248r2=1.249diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.248 php-src/ext/imap/php_imap.c:1.249
--- php-src/ext/imap/php_imap.c:1.248   Wed Apr  2 16:29:08 2008
+++ php-src/ext/imap/php_imap.c Tue Apr  8 00:02:01 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.248 2008/04/02 16:29:08 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.249 2008/04/08 00:02:01 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3046,8 +3046,8 @@
}
 
zend_hash_internal_pointer_reset(Z_ARRVAL_PP(body));
-   if (zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) data) != 
SUCCESS) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, body parameter 
cannot be empty);
+   if (zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) data) != 
SUCCESS || Z_TYPE_PP(data) != IS_ARRAY) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, body parameter 
must be a non-empty array);
RETURN_FALSE;
}
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-04-02 Thread Ilia Alshanetsky
iliaa   Wed Apr  2 16:29:08 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  
  MFB: Fixed bug #44613 (Crash inside imap_headerinfo())
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.247r2=1.248diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.247 php-src/ext/imap/php_imap.c:1.248
--- php-src/ext/imap/php_imap.c:1.247   Tue Apr  1 18:48:41 2008
+++ php-src/ext/imap/php_imap.c Wed Apr  2 16:29:08 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.247 2008/04/01 18:48:41 felipe Exp $ */
+/* $Id: php_imap.c,v 1.248 2008/04/02 16:29:08 iliaa Exp $ */
 
 #define IMAP41
 
@@ -1589,8 +1589,8 @@
convert_to_long_ex(msgno);
if (myargc = 3) {
convert_to_long_ex(fromlength);
-   if (Z_LVAL_PP(fromlength)  0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, From 
length has to be greater than or equal to 0);
+   if (Z_LVAL_PP(fromlength)  0 || Z_LVAL_PP(fromlength) = 
MAILTMPLEN) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, From 
length has to be between 1 and %i, MAILTMPLEN);
RETURN_FALSE;
}
} else {
@@ -1598,8 +1598,8 @@
}
if (myargc = 4) {
convert_to_long_ex(subjectlength);
-   if (Z_LVAL_PP(subjectlength)  0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Subject 
length has to be greater than or equal to 0);
+   if (Z_LVAL_PP(subjectlength)  0 || Z_LVAL_PP(subjectlength) = 
MAILTMPLEN) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Subject 
length has to be between 1 and %i, MAILTMPLEN);
RETURN_FALSE;
}
} else {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-04-01 Thread Ilia Alshanetsky
iliaa   Tue Apr  1 18:29:09 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  
  MFB: Fixed bug #44594 (imap_open() does not validate # of retries parameter)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.245r2=1.246diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.245 php-src/ext/imap/php_imap.c:1.246
--- php-src/ext/imap/php_imap.c:1.245   Fri Mar 28 16:45:59 2008
+++ php-src/ext/imap/php_imap.c Tue Apr  1 18:29:09 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.245 2008/03/28 16:45:59 felipe Exp $ */
+/* $Id: php_imap.c,v 1.246 2008/04/01 18:29:09 iliaa Exp $ */
 
 #define IMAP41
 
@@ -796,7 +796,11 @@
 #ifdef SET_MAXLOGINTRIALS
if (myargc == 5) {
convert_to_long_ex(retries);
-   mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));
+   if (retries  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING ,Retries 
must be greater or eqaul to 0);
+   } else {
+   mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));
+   }
}
 #endif
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-04-01 Thread Felipe Pena
felipe  Tue Apr  1 18:48:41 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Typo
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.246r2=1.247diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.246 php-src/ext/imap/php_imap.c:1.247
--- php-src/ext/imap/php_imap.c:1.246   Tue Apr  1 18:29:09 2008
+++ php-src/ext/imap/php_imap.c Tue Apr  1 18:48:41 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.246 2008/04/01 18:29:09 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.247 2008/04/01 18:48:41 felipe Exp $ */
 
 #define IMAP41
 
@@ -797,7 +797,7 @@
if (myargc == 5) {
convert_to_long_ex(retries);
if (retries  0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING ,Retries 
must be greater or eqaul to 0);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING ,Retries 
must be greater or equal to 0);
} else {
mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2008-03-28 Thread Felipe Pena
felipe  Fri Mar 28 16:45:59 2008 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: Fixed bug #44557 (Crash in imap_setacl when supplied integer as username)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.244r2=1.245diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.244 php-src/ext/imap/php_imap.c:1.245
--- php-src/ext/imap/php_imap.c:1.244   Thu Feb 28 14:16:12 2008
+++ php-src/ext/imap/php_imap.c Fri Mar 28 16:45:59 2008
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.244 2008/02/28 14:16:12 felipe Exp $ */
+/* $Id: php_imap.c,v 1.245 2008/03/28 16:45:59 felipe Exp $ */
 
 #define IMAP41
 
@@ -1053,6 +1053,7 @@
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, imap, 
le_imap);
 
convert_to_string_ex(mailbox);
+   convert_to_string_ex(id);
convert_to_string_ex(rights);
 
RETURN_BOOL(imap_setacl(imap_le_struct-imap_stream, 
Z_STRVAL_PP(mailbox), Z_STRVAL_PP(id), Z_STRVAL_PP(rights)));



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2007-07-30 Thread Stanislav Malyshev
stasTue Jul 31 00:32:18 2007 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  sometimes c-client returns non-null entry with null host
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.239r2=1.240diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.239 php-src/ext/imap/php_imap.c:1.240
--- php-src/ext/imap/php_imap.c:1.239   Mon May 28 23:33:13 2007
+++ php-src/ext/imap/php_imap.c Tue Jul 31 00:32:18 2007
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.239 2007/05/28 23:33:13 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.240 2007/07/31 00:32:18 stas Exp $ */
 
 #define IMAP41
 
@@ -3406,7 +3406,7 @@
addr = NULL;
rfc822_parse_adrlist(addr, tempMailTo, NULL);
while (addr) {
-   if (strcmp(addr-host, ERRHOST) == 0) {
+   if (addr-host == NULL || strcmp(addr-host, ERRHOST) 
== 0) {
PHP_IMAP_BAD_DEST;
} else {
bufferTo = safe_erealloc(bufferTo, bt_len, 1, 
strlen(addr-mailbox));
@@ -3435,7 +3435,7 @@
addr = NULL;
rfc822_parse_adrlist(addr, tempMailTo, NULL);
while (addr) {
-   if (strcmp(addr-host, ERRHOST) == 0) {
+   if (addr-host == NULL || strcmp(addr-host, ERRHOST) 
== 0) {
PHP_IMAP_BAD_DEST;
} else {
bufferCc = safe_erealloc(bufferCc, bt_len, 1, 
strlen(addr-mailbox));
@@ -3461,7 +3461,7 @@
addr = NULL;
rfc822_parse_adrlist(addr, tempMailTo, NULL);
while (addr) {
-   if (strcmp(addr-host, ERRHOST) == 0) {
+   if (addr-host == NULL || strcmp(addr-host, ERRHOST) 
== 0) {
PHP_IMAP_BAD_DEST;
} else {
bufferBcc = safe_erealloc(bufferBcc, bt_len, 1, 
strlen(addr-mailbox));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c /ext/interbase php_ibase_udf.c /ext/mime_magic mime_magic.c /ext/openssl openssl.c /ext/pdo_firebird firebird_statement.c /ext/pdo_pgsql pgsql_statemen

2007-05-28 Thread Ilia Alshanetsky
iliaa   Mon May 28 23:33:13 2007 UTC

  Modified files:  
/php-src/ext/sqlite sqlite.c php_sqlite.h 
/php-src/ext/socketsphp_sockets.h 
/php-src/ext/pdo_pgsql  pgsql_statement.c 
/php-src/ext/pdo_firebird   firebird_statement.c 
/php-src/ext/opensslopenssl.c 
/php-src/ext/mime_magic mime_magic.c 
/php-src/ext/interbase  php_ibase_udf.c 
/php-src/ext/imap   php_imap.c 
  Log:
  
  MFB
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.201r2=1.202diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.201 php-src/ext/sqlite/sqlite.c:1.202
--- php-src/ext/sqlite/sqlite.c:1.201   Wed Jan  3 20:49:27 2007
+++ php-src/ext/sqlite/sqlite.c Mon May 28 23:33:12 2007
@@ -17,7 +17,7 @@
|  Marcus Boerger [EMAIL PROTECTED]  |
+--+
 
-   $Id: sqlite.c,v 1.201 2007/01/03 20:49:27 tony2001 Exp $
+   $Id: sqlite.c,v 1.202 2007/05/28 23:33:12 iliaa Exp $
 */
 
 #ifdef HAVE_CONFIG_H
@@ -81,7 +81,7 @@
 extern int sqlite_decode_binary(const unsigned char *in, unsigned char *out);
 
 #define php_sqlite_encode_binary(in, n, out) sqlite_encode_binary((const 
unsigned char *)in, n, (unsigned char *)out)
-#define php_sqlite_decode_binary(in, out)sqlite_decode_binary((const 
unsigned char *)in, (unsigned char *)out)
+#define php_sqlite_decode_binary(in, out) in  *in ? 
sqlite_decode_binary((const unsigned char *)in, (unsigned char *)out) : 0
 
 static int sqlite_count_elements(zval *object, long *count TSRMLS_DC);
 
@@ -341,7 +341,7 @@
sqlite_functions,
PHP_MINIT(sqlite),
PHP_MSHUTDOWN(sqlite),
-   PHP_RINIT(sqlite),
+   NULL,
PHP_RSHUTDOWN(sqlite),
PHP_MINFO(sqlite),
 #if ZEND_MODULE_API_NO = 20010901
@@ -1220,7 +1220,7 @@
 {
php_info_print_table_start();
php_info_print_table_header(2, SQLite support, enabled);
-   php_info_print_table_row(2, PECL Module version, 
PHP_SQLITE_MODULE_VERSION  $Id: sqlite.c,v 1.201 2007/01/03 20:49:27 tony2001 
Exp $);
+   php_info_print_table_row(2, PECL Module version, 
PHP_SQLITE_MODULE_VERSION  $Id: sqlite.c,v 1.202 2007/05/28 23:33:12 iliaa Exp 
$);
php_info_print_table_row(2, SQLite Library, sqlite_libversion());
php_info_print_table_row(2, SQLite Encoding, sqlite_libencoding());
php_info_print_table_end();
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/php_sqlite.h?r1=1.36r2=1.37diff_format=u
Index: php-src/ext/sqlite/php_sqlite.h
diff -u php-src/ext/sqlite/php_sqlite.h:1.36 
php-src/ext/sqlite/php_sqlite.h:1.37
--- php-src/ext/sqlite/php_sqlite.h:1.36Mon Jan  1 09:29:30 2007
+++ php-src/ext/sqlite/php_sqlite.h Mon May 28 23:33:12 2007
@@ -17,7 +17,7 @@
|  Marcus Boerger [EMAIL PROTECTED]  |
+--+
 
-   $Id: php_sqlite.h,v 1.36 2007/01/01 09:29:30 sebastian Exp $ 
+   $Id: php_sqlite.h,v 1.37 2007/05/28 23:33:12 iliaa Exp $ 
 */
 
 #ifndef PHP_SQLITE_H
@@ -38,7 +38,6 @@
 
 PHP_MINIT_FUNCTION(sqlite);
 PHP_MSHUTDOWN_FUNCTION(sqlite);
-PHP_RINIT_FUNCTION(sqlite);
 PHP_RSHUTDOWN_FUNCTION(sqlite);
 PHP_MINFO_FUNCTION(sqlite);
 
http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/php_sockets.h?r1=1.39r2=1.40diff_format=u
Index: php-src/ext/sockets/php_sockets.h
diff -u php-src/ext/sockets/php_sockets.h:1.39 
php-src/ext/sockets/php_sockets.h:1.40
--- php-src/ext/sockets/php_sockets.h:1.39  Wed Jan 10 21:26:09 2007
+++ php-src/ext/sockets/php_sockets.h   Mon May 28 23:33:13 2007
@@ -22,7 +22,7 @@
 #ifndef PHP_SOCKETS_H
 #define PHP_SOCKETS_H
 
-/* $Id: php_sockets.h,v 1.39 2007/01/10 21:26:09 bjori Exp $ */
+/* $Id: php_sockets.h,v 1.40 2007/05/28 23:33:13 iliaa Exp $ */
 
 #if HAVE_SOCKETS
 
@@ -41,7 +41,6 @@
 
 PHP_MINIT_FUNCTION(sockets);
 PHP_MINFO_FUNCTION(sockets);
-PHP_RINIT_FUNCTION(sockets);
 PHP_RSHUTDOWN_FUNCTION(sockets);
 
 PHP_FUNCTION(socket_select);
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_pgsql/pgsql_statement.c?r1=1.43r2=1.44diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_statement.c
diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.43 
php-src/ext/pdo_pgsql/pgsql_statement.c:1.44
--- php-src/ext/pdo_pgsql/pgsql_statement.c:1.43Mon Jan  1 09:29:28 2007
+++ php-src/ext/pdo_pgsql/pgsql_statement.c Mon May 28 23:33:13 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: pgsql_statement.c,v 1.43 2007/01/01 09:29:28 sebastian Exp $ */
+/* $Id: pgsql_statement.c,v 1.44 2007/05/28 23:33:13 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -205,6 +205,7 @@

S-param_lengths[param-paramno] = 1;

S-param_formats[param-paramno] = 1;
  

[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2007-02-19 Thread Edin Kadribasic
edink   Mon Feb 19 16:04:14 2007 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.236r2=1.237diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.236 php-src/ext/imap/php_imap.c:1.237
--- php-src/ext/imap/php_imap.c:1.236   Fri Feb 16 13:28:32 2007
+++ php-src/ext/imap/php_imap.c Mon Feb 19 16:04:14 2007
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.236 2007/02/16 13:28:32 tony2001 Exp $ */
+/* $Id: php_imap.c,v 1.237 2007/02/19 16:04:14 edink Exp $ */
 
 #define IMAP41
 
@@ -475,11 +475,11 @@
auth_link(auth_gss);   /* link in the gss authenticator */
 #endif
auth_link(auth_pla);   /* link in the plain authenticator */
+#endif
 
 #ifdef HAVE_IMAP_SSL
ssl_onceonlyinit ();
 #endif
-#endif
 
/* lets allow NIL */
REGISTER_LONG_CONSTANT(NIL, NIL, CONST_PERSISTENT | CONST_CS);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2007-02-16 Thread Antony Dovgal
tony2001Fri Feb 16 13:28:32 2007 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: fix leak
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.235r2=1.236diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.235 php-src/ext/imap/php_imap.c:1.236
--- php-src/ext/imap/php_imap.c:1.235   Thu Jan 18 14:03:24 2007
+++ php-src/ext/imap/php_imap.c Fri Feb 16 13:28:32 2007
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.235 2007/01/18 14:03:24 tony2001 Exp $ */
+/* $Id: php_imap.c,v 1.236 2007/02/16 13:28:32 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -2211,6 +2211,9 @@
if (dest.data) {
free(dest.data);
}
+   if (src.data  src.data != dest.data) {
+   free(src.data);
+   }
 }
 /* }}} */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2007-01-18 Thread Antony Dovgal
tony2001Thu Jan 18 14:03:25 2007 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  use strlcat() 
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.234r2=1.235diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.234 php-src/ext/imap/php_imap.c:1.235
--- php-src/ext/imap/php_imap.c:1.234   Mon Jan  1 09:29:24 2007
+++ php-src/ext/imap/php_imap.c Thu Jan 18 14:03:24 2007
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.234 2007/01/01 09:29:24 sebastian Exp $ */
+/* $Id: php_imap.c,v 1.235 2007/01/18 14:03:24 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -1178,13 +1178,13 @@
if ((i = cache-user_flags)) {
strcat(tmp, {);
while (i) {
-   strcat(tmp, 
imap_le_struct-imap_stream-user_flags[find_rightmost_bit (i)]);
-   if (i) strcat(tmp,  );
+   strlcat(tmp, 
imap_le_struct-imap_stream-user_flags[find_rightmost_bit (i)], sizeof(tmp));
+   if (i) strlcat(tmp,  , sizeof(tmp));
}
-   strcat(tmp, } );
+   strlcat(tmp, } , sizeof(tmp));
}
mail_fetchsubject(t = tmp + strlen(tmp), 
imap_le_struct-imap_stream, msgno, (long)25);
-   sprintf(t += strlen(t),  (%ld chars), cache-rfc822_size);
+   snprintf(t += strlen(t), sizeof(tmp) - strlen(tmp),   (%ld 
chars), cache-rfc822_size);
add_next_index_string(return_value, tmp, 1);
}
 }
@@ -3383,14 +3383,14 @@
 #define PHP_IMAP_CLEAN if (bufferTo) efree(bufferTo); if (bufferCc) 
efree(bufferCc); if (bufferBcc) efree(bufferBcc); if (bufferHeader) 
efree(bufferHeader);
 #define PHP_IMAP_BAD_DEST PHP_IMAP_CLEAN; efree(tempMailTo); return 
(BAD_MSG_DESTINATION);
 
-   bufferHeader = (char *)emalloc(bufferLen);
+   bufferHeader = (char *)emalloc(bufferLen + 1);
memset(bufferHeader, 0, bufferLen);
if (to  *to) {
-   strcat(bufferHeader, To: );
-   strcat(bufferHeader, to);
-   strcat(bufferHeader, \r\n);
+   strlcat(bufferHeader, To: , bufferLen + 1);
+   strlcat(bufferHeader, to, bufferLen + 1);
+   strlcat(bufferHeader, \r\n, bufferLen + 1);
tempMailTo = estrdup(to);
-   bufferTo = (char *)emalloc(strlen(to));
+   bufferTo = (char *)emalloc(strlen(to) + 1);
offset = 0;
addr = NULL;
rfc822_parse_adrlist(addr, tempMailTo, NULL);
@@ -3409,11 +3409,11 @@
}
 
if (cc  *cc) {
-   strcat(bufferHeader, Cc: );
-   strcat(bufferHeader, cc);
-   strcat(bufferHeader, \r\n);
+   strlcat(bufferHeader, Cc: , bufferLen + 1);
+   strlcat(bufferHeader, cc, bufferLen + 1);
+   strlcat(bufferHeader, \r\n, bufferLen + 1);
tempMailTo = estrdup(cc);
-   bufferCc = (char *)emalloc(strlen(cc));
+   bufferCc = (char *)emalloc(strlen(cc) + 1);
offset = 0;
addr = NULL;
rfc822_parse_adrlist(addr, tempMailTo, NULL);
@@ -3433,7 +3433,7 @@
 
if (bcc  *bcc) {
tempMailTo = estrdup(bcc);
-   bufferBcc = (char *)emalloc(strlen(bcc));
+   bufferBcc = (char *)emalloc(strlen(bcc) + 1);
offset = 0;
addr = NULL;
rfc822_parse_adrlist(addr, tempMailTo, NULL);
@@ -3452,7 +3452,7 @@
}
 
if (headers  *headers) {
-   strcat(bufferHeader, headers);
+   strlcat(bufferHeader, headers, bufferLen + 1);
}
 
if (TSendMail(INI_STR(SMTP), tsm_err, tsm_errmsg, bufferHeader, 
subject, bufferTo, message, bufferCc, bufferBcc, rpath TSRMLS_CC) != SUCCESS) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-12-25 Thread Ilia Alshanetsky
iliaa   Mon Dec 25 14:23:38 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: Define SENDBUFLEN for older c-client libs
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.231r2=1.232diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.231 php-src/ext/imap/php_imap.c:1.232
--- php-src/ext/imap/php_imap.c:1.231   Sun Dec 24 22:15:18 2006
+++ php-src/ext/imap/php_imap.c Mon Dec 25 14:23:38 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.231 2006/12/24 22:15:18 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.232 2006/12/25 14:23:38 iliaa Exp $ */
 
 #define IMAP41
 
@@ -62,6 +62,9 @@
 #define CRLF_LEN sizeof(\015\012) - 1
 #define PHP_EXPUNGE 32768
 #define PHP_IMAP_ADDRESS_SIZE_BUF 10
+#ifdef SENDBUFLEN
+#define SENDBUFLEN 16385
+#endif
 
 static void _php_make_header_object(zval *myzvalue, ENVELOPE *en TSRMLS_DC);
 static void _php_imap_add_body(zval *arg, BODY *body TSRMLS_DC);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-12-25 Thread Antony Dovgal
tony2001Mon Dec 25 15:28:44 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  fix build
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.232r2=1.233diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.232 php-src/ext/imap/php_imap.c:1.233
--- php-src/ext/imap/php_imap.c:1.232   Mon Dec 25 14:23:38 2006
+++ php-src/ext/imap/php_imap.c Mon Dec 25 15:28:44 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.232 2006/12/25 14:23:38 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.233 2006/12/25 15:28:44 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -62,7 +62,7 @@
 #define CRLF_LEN sizeof(\015\012) - 1
 #define PHP_EXPUNGE 32768
 #define PHP_IMAP_ADDRESS_SIZE_BUF 10
-#ifdef SENDBUFLEN
+#ifndef SENDBUFLEN
 #define SENDBUFLEN 16385
 #endif
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-12-24 Thread Ilia Alshanetsky
iliaa   Sun Dec 24 22:15:18 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: Fixed buffer boundary protection
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.230r2=1.231diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.230 php-src/ext/imap/php_imap.c:1.231
--- php-src/ext/imap/php_imap.c:1.230   Sun Dec 17 18:23:10 2006
+++ php-src/ext/imap/php_imap.c Sun Dec 24 22:15:18 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.230 2006/12/17 18:23:10 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.231 2006/12/24 22:15:18 iliaa Exp $ */
 
 #define IMAP41
 
@@ -2946,7 +2946,7 @@
BODY *bod=NULL, *topbod=NULL;
PART *mypart=NULL, *part;
PARAMETER *param, *disp_param = NULL, *custom_headers_param = NULL, 
*tmp_param = NULL;
-   char tmp[8 * MAILTMPLEN], *mystring=NULL, *t=NULL, *tempstring=NULL;
+   char tmp[SENDBUFLEN + 1], *mystring=NULL, *t=NULL, *tempstring=NULL;
int toppart = 0;
 
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, envelope, body) 
== FAILURE) {
@@ -3247,8 +3247,8 @@
goto done;
}
 
-   rfc822_encode_body_7bit(env, topbod); 
-   rfc822_header (tmp, env, topbod);
+   rfc822_encode_body_7bit(env, topbod);
+   rfc822_header(tmp, env, topbod);
 
/* add custom envelope headers */
if (custom_headers_param) {
@@ -3297,43 +3297,42 @@
/* yucky default */
if (!cookie) {
cookie = -;  
+   } else if (strlen(cookie)  (sizeof(tmp) - 2 - 2)) {  
/* validate cookie length -- + CRLF */
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
The boudary should be no longer then 4kb);
+   RETVAL_FALSE;
+   goto done;  
}
 
/* for each part */
do {
t=tmp;
/* build cookie */
-   sprintf (t, --%s%s, cookie, CRLF);
+   sprintf(t, --%s%s, cookie, CRLF);
 
/* append mini-header */
rfc822_write_body_header(t, part-body);
 
/* write terminating blank line */
-   strcat (t, CRLF);
+   strcat(t, CRLF);
 
/* output cookie, mini-header, and contents */
-   
tempstring=emalloc(strlen(mystring)+strlen(tmp)+1);
-   sprintf(tempstring, %s%s, mystring, tmp);
+   spprintf(tempstring, 0, %s%s, mystring, tmp);
efree(mystring);
mystring=tempstring;
 
bod=part-body;
 
-   
tempstring=emalloc(strlen(bod-contents.text.data)+strlen(CRLF)+strlen(mystring)+1);
-   sprintf(tempstring, %s%s%s, mystring, 
bod-contents.text.data, CRLF);
+   spprintf(tempstring, 0, %s%s%s, mystring, 
bod-contents.text.data, CRLF);
efree(mystring);
mystring=tempstring;
} while ((part = part-next)); /* until done */
 
/* output trailing cookie */
-   sprintf(tmp, --%s--, cookie);
-   
tempstring=emalloc(strlen(tmp)+strlen(CRLF)+strlen(mystring)+1);
-   sprintf(tempstring, %s%s%s, mystring, tmp, CRLF);
+   spprintf(tempstring, 0, %s--%s--%s, mystring, tmp, 
CRLF);
efree(mystring);
mystring=tempstring;
} else if (bod) {
-   tempstring = 
emalloc(strlen(bod-contents.text.data)+strlen(CRLF)+strlen(mystring)+1);
-   sprintf(tempstring, %s%s%s, mystring, 
bod-contents.text.data, CRLF);
+   spprintf(tempstring, 0, %s%s%s, mystring, 
bod-contents.text.data, CRLF);
efree(mystring);
mystring=tempstring;
} else {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-12-17 Thread Ilia Alshanetsky
iliaa   Sun Dec 17 18:23:10 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: Fixed bug #39779 (Enable AUTH PLAIN mechanism in underlaying
  libc-client).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.229r2=1.230diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.229 php-src/ext/imap/php_imap.c:1.230
--- php-src/ext/imap/php_imap.c:1.229   Fri Nov 24 10:28:26 2006
+++ php-src/ext/imap/php_imap.c Sun Dec 17 18:23:10 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.229 2006/11/24 10:28:26 tony2001 Exp $ */
+/* $Id: php_imap.c,v 1.230 2006/12/17 18:23:10 iliaa Exp $ */
 
 #define IMAP41
 
@@ -471,6 +471,7 @@
 #if HAVE_IMAP_KRB  defined(HAVE_IMAP_AUTH_GSS)
auth_link(auth_gss);   /* link in the gss authenticator */
 #endif
+   auth_link(auth_pla);   /* link in the plain authenticator */
 
 #ifdef HAVE_IMAP_SSL
ssl_onceonlyinit ();

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-11-05 Thread Ilia Alshanetsky
iliaa   Sun Nov  5 18:32:41 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: Fixed bug #39362 (Added an option to imap_open/imap_reopen to control
  the number of connection retries).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.226r2=1.227diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.226 php-src/ext/imap/php_imap.c:1.227
--- php-src/ext/imap/php_imap.c:1.226   Sun Oct  8 13:34:22 2006
+++ php-src/ext/imap/php_imap.c Sun Nov  5 18:32:41 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.226 2006/10/08 13:34:22 bjori Exp $ */
+/* $Id: php_imap.c,v 1.227 2006/11/05 18:32:41 iliaa Exp $ */
 
 #define IMAP41
 
@@ -736,21 +736,21 @@
  */
 static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
 {
-   zval **mailbox, **user, **passwd, **options;
+   zval **mailbox, **user, **passwd, **options, **retries;
MAILSTREAM *imap_stream;
pils *imap_le_struct;
long flags=NIL;
long cl_flags=NIL;
int myargc = ZEND_NUM_ARGS();

-   if (myargc  3 || myargc  4 || zend_get_parameters_ex(myargc, 
mailbox, user, passwd, options) == FAILURE) {
+   if (myargc  3 || myargc  4 || zend_get_parameters_ex(myargc, 
mailbox, user, passwd, options, retries) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
 
convert_to_string_ex(mailbox);
convert_to_string_ex(user);
convert_to_string_ex(passwd);
-   if (myargc ==4) {
+   if (myargc = 4) {
convert_to_long_ex(options);
flags = Z_LVAL_PP(options);
if (flags  PHP_EXPUNGE) {
@@ -775,6 +775,13 @@
IMAPG(imap_user) = estrndup(Z_STRVAL_PP(user), Z_STRLEN_PP(user));
IMAPG(imap_password) = estrndup(Z_STRVAL_PP(passwd), 
Z_STRLEN_PP(passwd));
 
+#ifdef SET_MAXLOGINTRIALS
+   if (myargc == 5) {
+   convert_to_long_ex(retries);
+   mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));
+   }
+#endif
+
imap_stream = mail_open(NIL, Z_STRVAL_PP(mailbox), flags);
 
if (imap_stream == NIL) {
@@ -792,7 +799,7 @@
 }
 /* }}} */
 
-/* {{{ proto resource imap_open(string mailbox, string user, string password 
[, int options])
+/* {{{ proto resource imap_open(string mailbox, string user, string password 
[, int options [, int n_retries]])
Open an IMAP stream to a mailbox */
 PHP_FUNCTION(imap_open)
 {
@@ -800,18 +807,18 @@
 }
 /* }}} */
 
-/* {{{ proto bool imap_reopen(resource stream_id, string mailbox [, int 
options])
+/* {{{ proto bool imap_reopen(resource stream_id, string mailbox [, int 
options [, int n_retries]])
Reopen an IMAP stream to a new mailbox */
 PHP_FUNCTION(imap_reopen)
 {
-   zval **streamind, **mailbox, **options;
+   zval **streamind, **mailbox, **options, **retries;
pils *imap_le_struct; 
MAILSTREAM *imap_stream;
long flags=NIL;
long cl_flags=NIL;
int myargc=ZEND_NUM_ARGS();
 
-   if (myargc  2 || myargc  3 || zend_get_parameters_ex(myargc, 
streamind, mailbox, options) == FAILURE) {
+   if (myargc  2 || myargc  4 || zend_get_parameters_ex(myargc, 
streamind, mailbox, options, retries) == FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
 
@@ -819,7 +826,7 @@
 
convert_to_string_ex(mailbox);
 
-   if (myargc == 3) {
+   if (myargc = 3) {
convert_to_long_ex(options);
flags = Z_LVAL_PP(options);
if (flags  PHP_EXPUNGE) {
@@ -828,7 +835,12 @@
}
imap_le_struct-flags = cl_flags;   
}
-
+#ifdef SET_MAXLOGINTRIALS
+   if (myargc == 4) {
+   convert_to_long_ex(retries);
+   mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 
Z_LVAL_PP(retries));
+   }
+#endif
/* local filename, need to perform open_basedir checks */
if (Z_STRVAL_PP(mailbox)[0] != '{'  
php_check_open_basedir(Z_STRVAL_PP(mailbox) TSRMLS_CC)) {
RETURN_FALSE;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-10-05 Thread Antony Dovgal
tony2001Thu Oct  5 14:28:33 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: fix build with new c-client
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.224r2=1.225diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.224 php-src/ext/imap/php_imap.c:1.225
--- php-src/ext/imap/php_imap.c:1.224   Sun Sep 24 18:06:53 2006
+++ php-src/ext/imap/php_imap.c Thu Oct  5 14:28:33 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.224 2006/09/24 18:06:53 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.225 2006/10/05 14:28:33 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -2177,7 +2177,12 @@
dest.size = 0;
 
cpytxt(src, Z_STRVAL_PP(str), Z_STRLEN_PP(str));
+
+#ifndef HAVE_NEW_MIME2TEXT
utf8_mime2text(src, dest);
+#else
+   utf8_mime2text(src, dest, U8T_CANONICAL);
+#endif
RETVAL_STRINGL(dest.data, dest.size, 1);
if (dest.data) {
free(dest.data);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c /ext/imap/tests imap_utf8.phpt

2006-09-05 Thread Antony Dovgal
tony2001Tue Sep  5 11:16:06 2006 UTC

  Added files: 
/php-src/ext/imap/tests imap_utf8.phpt 

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  fix leak in imap_utf8(), avoid extra strlen() call
  add test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.221r2=1.222diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.221 php-src/ext/imap/php_imap.c:1.222
--- php-src/ext/imap/php_imap.c:1.221   Thu Aug 31 16:14:43 2006
+++ php-src/ext/imap/php_imap.c Tue Sep  5 11:16:06 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.221 2006/08/31 16:14:43 tony2001 Exp $ */
+/* $Id: php_imap.c,v 1.222 2006/09/05 11:16:06 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -2174,7 +2174,7 @@
 
cpytxt(src, Z_STRVAL_PP(str), Z_STRLEN_PP(str));
utf8_mime2text(src, dest);
-   RETURN_STRINGL(dest.data, strlen(dest.data), 1);
+   RETURN_STRINGL(dest.data, dest.size, 0);
 }
 /* }}} */
 

http://cvs.php.net/viewvc.cgi/php-src/ext/imap/tests/imap_utf8.phpt?view=markuprev=1.1
Index: php-src/ext/imap/tests/imap_utf8.phpt
+++ php-src/ext/imap/tests/imap_utf8.phpt
--TEST--
imap_utf8() tests
--SKIPIF--
?php if (!extension_loaded(imap)) print skip; ?
--FILE--
?php

var_dump(imap_utf8());
var_dump(imap_utf8(1));
var_dump(imap_utf8(array(1,2)));
var_dump(imap_utf8(test));

echo Done\n;
?
--EXPECTF-- 
string(0) 
string(1) 1

Notice: Array to string conversion in %s on line %d
string(5) Array
string(4) test
Done
--UEXPECTF--
string(0) 
string(1) 1

Notice: Array to string conversion in %s on line %d
string(5) Array
string(4) test
Done

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-09-05 Thread Antony Dovgal
tony2001Tue Sep  5 11:24:23 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  fix it in an other way
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.222r2=1.223diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.222 php-src/ext/imap/php_imap.c:1.223
--- php-src/ext/imap/php_imap.c:1.222   Tue Sep  5 11:16:06 2006
+++ php-src/ext/imap/php_imap.c Tue Sep  5 11:24:23 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.222 2006/09/05 11:16:06 tony2001 Exp $ */
+/* $Id: php_imap.c,v 1.223 2006/09/05 11:24:23 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -2174,7 +2174,10 @@
 
cpytxt(src, Z_STRVAL_PP(str), Z_STRLEN_PP(str));
utf8_mime2text(src, dest);
-   RETURN_STRINGL(dest.data, dest.size, 0);
+   RETVAL_STRINGL(dest.data, dest.size, 1);
+   if (dest.data) {
+   free(dest.data);
+   }
 }
 /* }}} */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c /ext/oci8 oci8_statement.c /ext/posix posix.c /ext/reflection php_reflection.c /ext/sockets sockets.c

2006-08-31 Thread Antony Dovgal
tony2001Thu Aug 31 16:14:43 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
/php-src/ext/oci8   oci8_statement.c 
/php-src/ext/posix  posix.c 
/php-src/ext/reflection php_reflection.c 
/php-src/ext/socketssockets.c 
  Log:
  last portion of z/Z fixes
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.220r2=1.221diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.220 php-src/ext/imap/php_imap.c:1.221
--- php-src/ext/imap/php_imap.c:1.220   Fri Aug 11 18:06:28 2006
+++ php-src/ext/imap/php_imap.c Thu Aug 31 16:14:43 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.220 2006/08/11 18:06:28 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.221 2006/08/31 16:14:43 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -1872,14 +1872,14 @@
Save a specific body section to a file */
 PHP_FUNCTION(imap_savebody)
 {
-   zval *stream, *out;
+   zval *stream, **out;
pils *imap_ptr = NULL;
php_stream *writer = NULL;
char *section = ;
int section_len = 0, close_stream = 1;
long msgno, flags = 0;

-   if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
rzl|sl, stream, out, msgno, section, section_len, flags)) {
+   if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 
rZl|sl, stream, out, msgno, section, section_len, flags)) {
RETURN_FALSE;
}

@@ -1889,17 +1889,17 @@
RETURN_FALSE;
}

-   switch (Z_TYPE_P(out))
+   switch (Z_TYPE_PP(out))
{
case IS_LONG:
case IS_RESOURCE:
close_stream = 0;
-   php_stream_from_zval(writer, out);
+   php_stream_from_zval(writer, out);
break;
 
default:
-   convert_to_string_ex(out);
-   writer = php_stream_open_wrapper(Z_STRVAL_P(out), wb, 
REPORT_ERRORS, NULL);
+   convert_to_string_ex(out);
+   writer = php_stream_open_wrapper(Z_STRVAL_PP(out), 
wb, REPORT_ERRORS, NULL);
break;
}

http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8_statement.c?r1=1.27r2=1.28diff_format=u
Index: php-src/ext/oci8/oci8_statement.c
diff -u php-src/ext/oci8/oci8_statement.c:1.27 
php-src/ext/oci8/oci8_statement.c:1.28
--- php-src/ext/oci8/oci8_statement.c:1.27  Tue Aug 22 11:08:28 2006
+++ php-src/ext/oci8/oci8_statement.c   Thu Aug 31 16:14:43 2006
@@ -25,7 +25,7 @@
+--+
 */
 
-/* $Id: oci8_statement.c,v 1.27 2006/08/22 11:08:28 tony2001 Exp $ */
+/* $Id: oci8_statement.c,v 1.28 2006/08/31 16:14:43 tony2001 Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -1079,11 +1079,11 @@
  Helper function to get column by name and index */
 php_oci_out_column 
*php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int 
need_data)
 {
-   zval *z_statement, *column_index;
+   zval *z_statement, **column_index;
php_oci_statement *statement;
php_oci_out_column *column;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rz, 
z_statement, column_index) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rZ, 
z_statement, column_index) == FAILURE) {
return NULL;
}
 
@@ -1097,17 +1097,17 @@
return NULL;
}

-   if (Z_TYPE_P(column_index) == IS_STRING) {
-   column = php_oci_statement_get_column(statement, -1, 
Z_STRVAL_P(column_index), Z_STRLEN_P(column_index) TSRMLS_CC);
+   if (Z_TYPE_PP(column_index) == IS_STRING) {
+   column = php_oci_statement_get_column(statement, -1, 
Z_STRVAL_PP(column_index), Z_STRLEN_PP(column_index) TSRMLS_CC);
if (!column) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid 
column name \%s\, Z_STRVAL_P(column_index));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid 
column name \%s\, Z_STRVAL_PP(column_index));
return NULL;
}
} else {
-   convert_to_long(column_index);
-   column = php_oci_statement_get_column(statement, 
Z_LVAL_P(column_index), NULL, 0 TSRMLS_CC);
+   convert_to_long_ex(column_index);
+   column = php_oci_statement_get_column(statement, 
Z_LVAL_PP(column_index), NULL, 0 TSRMLS_CC);
if (!column) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid 
column index \%ld\, Z_LVAL_P(column_index));
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid 
column index \%ld\, 

[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-08-11 Thread Ilia Alshanetsky
iliaa   Fri Aug 11 15:09:43 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: Extend safe_mode/open_basedir checks to imap_reopen() as well.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.218r2=1.219diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.218 php-src/ext/imap/php_imap.c:1.219
--- php-src/ext/imap/php_imap.c:1.218   Fri Aug  4 20:34:37 2006
+++ php-src/ext/imap/php_imap.c Fri Aug 11 15:09:43 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.218 2006/08/04 20:34:37 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.219 2006/08/11 15:09:43 iliaa Exp $ */
 
 #define IMAP41
 
@@ -824,6 +824,14 @@
}
imap_le_struct-flags = cl_flags;   
}
+
+   /* local filename, need to perform open_basedir and safe_mode checks */
+   if (Z_STRVAL_PP(mailbox)[0] != '{'  
+   (php_check_open_basedir(Z_STRVAL_PP(mailbox) TSRMLS_CC) 
|| 
+   (PG(safe_mode)  !php_checkuid(Z_STRVAL_PP(mailbox), 
NULL, CHECKUID_CHECK_FILE_AND_DIR {
+   RETURN_FALSE;
+   }
+
imap_stream = mail_open(imap_le_struct-imap_stream, 
Z_STRVAL_PP(mailbox), flags);
if (imap_stream == NIL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Couldn't re-open 
stream);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-08-11 Thread Ilia Alshanetsky
iliaa   Fri Aug 11 18:06:28 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  PHP 6 does not have safe_mode
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.219r2=1.220diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.219 php-src/ext/imap/php_imap.c:1.220
--- php-src/ext/imap/php_imap.c:1.219   Fri Aug 11 15:09:43 2006
+++ php-src/ext/imap/php_imap.c Fri Aug 11 18:06:28 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.219 2006/08/11 15:09:43 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.220 2006/08/11 18:06:28 iliaa Exp $ */
 
 #define IMAP41
 
@@ -825,10 +825,8 @@
imap_le_struct-flags = cl_flags;   
}
 
-   /* local filename, need to perform open_basedir and safe_mode checks */
-   if (Z_STRVAL_PP(mailbox)[0] != '{'  
-   (php_check_open_basedir(Z_STRVAL_PP(mailbox) TSRMLS_CC) 
|| 
-   (PG(safe_mode)  !php_checkuid(Z_STRVAL_PP(mailbox), 
NULL, CHECKUID_CHECK_FILE_AND_DIR {
+   /* local filename, need to perform open_basedir checks */
+   if (Z_STRVAL_PP(mailbox)[0] != '{'  
php_check_open_basedir(Z_STRVAL_PP(mailbox) TSRMLS_CC)) {
RETURN_FALSE;
}
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-08-04 Thread Ilia Alshanetsky
iliaa   Fri Aug  4 20:34:37 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: Fixed bug #37265 (Added missing safe_mode  open_basedir checks to
  imap_body()). 
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.217r2=1.218diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.217 php-src/ext/imap/php_imap.c:1.218
--- php-src/ext/imap/php_imap.c:1.217   Tue Jun 13 13:12:18 2006
+++ php-src/ext/imap/php_imap.c Fri Aug  4 20:34:37 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.217 2006/06/13 13:12:18 dmitry Exp $ */
+/* $Id: php_imap.c,v 1.218 2006/08/04 20:34:37 iliaa Exp $ */
 
 #define IMAP41
 
@@ -763,6 +763,11 @@
efree(IMAPG(imap_password));
}
 
+   /* local filename, need to perform open_basedir checks */
+   if (Z_STRVAL_PP(mailbox)[0] != '{'  
php_check_open_basedir(Z_STRVAL_PP(mailbox) TSRMLS_CC)) {
+   RETURN_FALSE;
+   }
+
IMAPG(imap_user) = estrndup(Z_STRVAL_PP(user), Z_STRLEN_PP(user));
IMAPG(imap_password) = estrndup(Z_STRVAL_PP(passwd), 
Z_STRLEN_PP(passwd));
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-01-28 Thread Michael Wallner
mikeSat Jan 28 08:08:48 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MF51: use free()
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/imap/php_imap.c?r1=1.214r2=1.215diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.214 php-src/ext/imap/php_imap.c:1.215
--- php-src/ext/imap/php_imap.c:1.214   Fri Jan 27 20:22:48 2006
+++ php-src/ext/imap/php_imap.c Sat Jan 28 08:08:48 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.214 2006/01/27 20:22:48 mike Exp $ */
+/* $Id: php_imap.c,v 1.215 2006/01/28 08:08:48 mike Exp $ */
 
 #define IMAP41
 
@@ -4246,7 +4246,7 @@
buf[size] = '\0';
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to 
read from socket);
-   efree(buf);
+   free(buf);
buf = NULL;
}
return buf;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2006-01-27 Thread Michael Wallner
mikeFri Jan 27 20:22:48 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MF_5_1
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/imap/php_imap.c?r1=1.213r2=1.214diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.213 php-src/ext/imap/php_imap.c:1.214
--- php-src/ext/imap/php_imap.c:1.213   Fri Jan 27 19:44:40 2006
+++ php-src/ext/imap/php_imap.c Fri Jan 27 20:22:48 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.213 2006/01/27 19:44:40 mike Exp $ */
+/* $Id: php_imap.c,v 1.214 2006/01/27 20:22:48 mike Exp $ */
 
 #define IMAP41
 
@@ -68,8 +68,6 @@
 static void _php_imap_parse_address(ADDRESS *addresslist, char **fulladdress, 
zval *paddress TSRMLS_DC);
 static int _php_imap_address_size(ADDRESS *addresslist);
 
-/* c-clients gets */
-static mailgets_t old_mail_gets;
 /* the gets we use */
 static char *php_mail_gets(readfn_t f, void *stream, unsigned long size, 
GETS_DATA *md);
 
@@ -469,7 +467,6 @@
REGISTER_LONG_CONSTANT(NIL, NIL, CONST_PERSISTENT | CONST_CS);
 
/* plug in our gets */
-   old_mail_gets = mail_parameters(NIL, GET_GETS, NIL);
mail_parameters(NIL, SET_GETS, (void *) php_mail_gets);
 
/* set default timeout values */
@@ -4243,7 +4240,16 @@
}
return NULL;
} else {
-   return old_mail_gets(f, stream, size, md);
+   char *buf = malloc(size + 1);
+   
+   if (f(stream, size, buf)) {
+   buf[size] = '\0';
+   } else {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to 
read from socket);
+   efree(buf);
+   buf = NULL;
+   }
+   return buf;
}
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c /ext/imap/tests bug35669.phpt

2006-01-04 Thread Ilia Alshanetsky
iliaa   Thu Jan  5 00:51:34 2006 UTC

  Modified files:  
/php-src/ext/imap   php_imap.c 
/php-src/ext/imap/tests bug35669.phpt 
  Log:
  MFB51: Fixed bug #35669 (imap_mail_compose() crashes with 
  multipart-multiboundary-email). 
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/imap/php_imap.c?r1=1.211r2=1.212diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.211 php-src/ext/imap/php_imap.c:1.212
--- php-src/ext/imap/php_imap.c:1.211   Sun Jan  1 13:09:50 2006
+++ php-src/ext/imap/php_imap.c Thu Jan  5 00:51:34 2006
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.211 2006/01/01 13:09:50 sniper Exp $ */
+/* $Id: php_imap.c,v 1.212 2006/01/05 00:51:34 iliaa Exp $ */
 
 #define IMAP41
 
@@ -2837,9 +2837,10 @@
char *cookie = NIL;
ENVELOPE *env;
BODY *bod=NULL, *topbod=NULL;
-   PART *mypart=NULL, *toppart=NULL, *part;
+   PART *mypart=NULL, *part;
PARAMETER *param, *disp_param = NULL, *custom_headers_param = NULL, 
*tmp_param = NULL;
char tmp[8 * MAILTMPLEN], *mystring=NULL, *t=NULL, *tempstring=NULL;
+   int toppart = 0;
 
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, envelope, body) 
== FAILURE) {
ZEND_WRONG_PARAM_COUNT();
@@ -2922,7 +2923,6 @@
php_error_docref(NULL TSRMLS_CC, E_WARNING, body parameter 
cannot be empty);
RETURN_FALSE;
}
-   zend_hash_get_current_key(Z_ARRVAL_PP(body), key, ind, 0); /* FIXME: 
is this necessary?  we're not using key/ind */
 
if (Z_TYPE_PP(data) == IS_ARRAY) {
bod = mail_newbody();
@@ -3022,23 +3022,28 @@
zend_hash_move_forward(Z_ARRVAL_PP(body));
 
while (zend_hash_get_current_data(Z_ARRVAL_PP(body), (void **) data) 
== SUCCESS) {
-   zend_hash_get_current_key(Z_ARRVAL_PP(body), key, ind, 0);  
/* FIXME: Is this necessary?  We're not using key/ind */
if (Z_TYPE_PP(data) == IS_ARRAY) {
+   short type = -1;
+   if (zend_hash_find(Z_ARRVAL_PP(data), type, 
sizeof(type), (void **) pvalue)== SUCCESS) {
+   convert_to_long_ex(pvalue);
+   type = (short) Z_LVAL_PP(pvalue);
+   }
+
if (!toppart) {
bod-nested.part = mail_newbody_part();
mypart = bod-nested.part;
-   toppart = mypart;
-   bod=mypart-body;
+   toppart = 1;
} else {
-mypart-next = mail_newbody_part();
-mypart = mypart-next;
-bod = mypart-body;
+   mypart-next = mail_newbody_part();
+   mypart = mypart-next;
}
 
-   if (zend_hash_find(Z_ARRVAL_PP(data), type, 
sizeof(type), (void **) pvalue)== SUCCESS) {
-   convert_to_long_ex(pvalue);
-   bod-type = (short) Z_LVAL_PP(pvalue);
-   }
+   bod = mypart-body;
+
+   if (type != TYPEMULTIPART) {
+   bod-type = type;
+   }   
+
if (zend_hash_find(Z_ARRVAL_PP(data), encoding, 
sizeof(encoding), (void **) pvalue)== SUCCESS) {
convert_to_long_ex(pvalue);
bod-encoding = (short) Z_LVAL_PP(pvalue);
@@ -3135,12 +3140,6 @@
goto done;
}
 
-   if (bod  bod-type == TYPEMULTIPART  (!bod-nested.part || 
!bod-nested.part-next)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, cannot generate 
multipart e-mail without components.);
-   RETVAL_FALSE;
-   goto done;
-   }
-
rfc822_encode_body_7bit(env, topbod); 
rfc822_header (tmp, env, topbod);
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/imap/tests/bug35669.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/imap/tests/bug35669.phpt
diff -u /dev/null php-src/ext/imap/tests/bug35669.phpt:1.2
--- /dev/null   Thu Jan  5 00:51:34 2006
+++ php-src/ext/imap/tests/bug35669.phptThu Jan  5 00:51:34 2006
@@ -0,0 +1,68 @@
+--TEST-- 
+Bug #35669 (imap_mail_compose() crashes with multipart-multiboundary-email)
+--SKIPIF--
+?php
+if (!extension_loaded(imap)) { 
+die(skip imap extension not available);  
+}
+?
+--FILE--
+?php
+   $envelope[from] = 'Santa [EMAIL PROTECTED]';
+$envelope[to]  = 'The bad smurf [EMAIL 

[PHP-CVS] cvs: php-src /ext/imap php_imap.c /ext/imap/tests bug32589.phpt

2005-08-30 Thread Ilia Alshanetsky
iliaa   Tue Aug 30 18:02:45 2005 EDT

  Added files: 
/php-src/ext/imap/tests bug32589.phpt 

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed bug #32589 (possible crash inside imap_mail_compose() function).
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.208r2=1.209ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208 php-src/ext/imap/php_imap.c:1.209
--- php-src/ext/imap/php_imap.c:1.208   Sun Aug  7 18:06:27 2005
+++ php-src/ext/imap/php_imap.c Tue Aug 30 18:02:43 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.208 2005/08/07 22:06:27 sniper Exp $ */
+/* $Id: php_imap.c,v 1.209 2005/08/30 22:02:43 iliaa Exp $ */
 
 #define IMAP41
 
@@ -2908,6 +2908,7 @@
custom_headers_param = mail_newbody_parameter();
convert_to_string_ex(env_data);
custom_headers_param-value = (char *) 
fs_get(Z_STRLEN_PP(env_data) + 1);
+   custom_headers_param-attribute = NULL;
memcpy(custom_headers_param-value, 
Z_STRVAL_PP(env_data), Z_STRLEN_PP(env_data) + 1);
zend_hash_move_forward(Z_ARRVAL_PP(pvalue));
custom_headers_param-next = tmp_param;
@@ -2939,7 +2940,7 @@
convert_to_string_ex(pvalue);
tmp_param = mail_newbody_parameter();
tmp_param-value = cpystr(Z_STRVAL_PP(pvalue));
-   tmp_param-attribute = CHARSET;
+   tmp_param-attribute = cpystr(CHARSET);
tmp_param-next = bod-parameter;
bod-parameter = tmp_param;
}
@@ -2949,7 +2950,7 @@
while 
(zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) disp_data) == 
SUCCESS) {
disp_param = mail_newbody_parameter();

zend_hash_get_current_key(Z_ARRVAL_PP(pvalue), key, ind, 0);
-   disp_param-attribute = key;
+   disp_param-attribute = cpystr(key);
convert_to_string_ex(disp_data);
disp_param-value = (char *) 
fs_get(Z_STRLEN_PP(disp_data) + 1);
memcpy(disp_param-value, 
Z_STRVAL_PP(disp_data), Z_STRLEN_PP(disp_data) + 1);
@@ -2983,7 +2984,7 @@
while 
(zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) disp_data) == 
SUCCESS) {
disp_param = mail_newbody_parameter();

zend_hash_get_current_key(Z_ARRVAL_PP(pvalue), key, ind, 0);
-   disp_param-attribute = key;
+   disp_param-attribute = cpystr(key);
convert_to_string_ex(disp_data);
disp_param-value = (char *) 
fs_get(Z_STRLEN_PP(disp_data) + 1);
memcpy(disp_param-value, 
Z_STRVAL_PP(disp_data), Z_STRLEN_PP(disp_data) + 1);
@@ -3047,7 +3048,7 @@
tmp_param = mail_newbody_parameter();
tmp_param-value = (char *) 
fs_get(Z_STRLEN_PP(pvalue) + 1);
memcpy(tmp_param-value, Z_STRVAL_PP(pvalue), 
Z_STRLEN_PP(pvalue) + 1);
-   tmp_param-attribute = CHARSET;
+   tmp_param-attribute = cpystr(CHARSET);
tmp_param-next = bod-parameter;
bod-parameter = tmp_param;
}
@@ -3057,7 +3058,7 @@
while 
(zend_hash_get_current_data(Z_ARRVAL_PP(pvalue), (void **) disp_data) == 
SUCCESS) {
disp_param = 
mail_newbody_parameter();

zend_hash_get_current_key(Z_ARRVAL_PP(pvalue), key, ind, 0);
-   disp_param-attribute = key;
+   disp_param-attribute = 
cpystr(key);
convert_to_string_ex(disp_data);
disp_param-value = (char *) 
fs_get(Z_STRLEN_PP(disp_data) + 1);
memcpy(disp_param-value, 
Z_STRVAL_PP(disp_data), Z_STRLEN_PP(disp_data) + 1);
@@ -3091,7 +3092,7 @@
while 

[PHP-CVS] cvs: php-src /ext/imap php_imap.c /ext/standard mail.c /win32 sendmail.c sendmail.h

2005-08-07 Thread Jani Taskinen
sniper  Sun Aug  7 18:06:29 2005 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
/php-src/ext/standard   mail.c 
/php-src/win32  sendmail.c sendmail.h 
  Log:
  - Fixed bug #29334 (mail() provides incorrect message time header)
  http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.207r2=1.208ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.207 php-src/ext/imap/php_imap.c:1.208
--- php-src/ext/imap/php_imap.c:1.207   Wed Aug  3 10:07:16 2005
+++ php-src/ext/imap/php_imap.c Sun Aug  7 18:06:27 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.207 2005/08/03 14:07:16 sniper Exp $ */
+/* $Id: php_imap.c,v 1.208 2005/08/07 22:06:27 sniper Exp $ */
 
 #define IMAP41
 
@@ -3346,7 +3346,7 @@
strcat(bufferHeader, headers);
}
 
-   if (TSendMail(INI_STR(SMTP), tsm_err, tsm_errmsg, bufferHeader, 
subject, bufferTo, message, bufferCc, bufferBcc, rpath) != SUCCESS) {
+   if (TSendMail(INI_STR(SMTP), tsm_err, tsm_errmsg, bufferHeader, 
subject, bufferTo, message, bufferCc, bufferBcc, rpath TSRMLS_CC) != SUCCESS) {
if (tsm_errmsg) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, %s, 
tsm_errmsg);
efree(tsm_errmsg);
http://cvs.php.net/diff.php/php-src/ext/standard/mail.c?r1=1.86r2=1.87ty=u
Index: php-src/ext/standard/mail.c
diff -u php-src/ext/standard/mail.c:1.86 php-src/ext/standard/mail.c:1.87
--- php-src/ext/standard/mail.c:1.86Wed Aug  3 10:08:08 2005
+++ php-src/ext/standard/mail.c Sun Aug  7 18:06:28 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: mail.c,v 1.86 2005/08/03 14:08:08 sniper Exp $ */
+/* $Id: mail.c,v 1.87 2005/08/07 22:06:28 sniper Exp $ */
 
 #include stdlib.h
 #include ctype.h
@@ -185,7 +185,7 @@
if (!sendmail_path) {
 #if (defined PHP_WIN32 || defined NETWARE)
/* handle old style win smtp sending */
-   if (TSendMail(INI_STR(SMTP), tsm_err, tsm_errmsg, headers, 
subject, to, message, NULL, NULL, NULL) == FAILURE) {
+   if (TSendMail(INI_STR(SMTP), tsm_err, tsm_errmsg, headers, 
subject, to, message, NULL, NULL, NULL TSRMLS_CC) == FAILURE) {
if (tsm_errmsg) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
%s, tsm_errmsg);
efree(tsm_errmsg);
http://cvs.php.net/diff.php/php-src/win32/sendmail.c?r1=1.64r2=1.65ty=u
Index: php-src/win32/sendmail.c
diff -u php-src/win32/sendmail.c:1.64 php-src/win32/sendmail.c:1.65
--- php-src/win32/sendmail.c:1.64   Thu Jul 28 05:44:13 2005
+++ php-src/win32/sendmail.cSun Aug  7 18:06:29 2005
@@ -17,7 +17,7 @@
  *
  */
 
-/* $Id: sendmail.c,v 1.64 2005/07/28 09:44:13 hyanantha Exp $ */
+/* $Id: sendmail.c,v 1.65 2005/08/07 22:06:29 sniper Exp $ */
 
 #include php.h   /*php specific */
 #include stdio.h
@@ -42,23 +42,15 @@
 #include ext/pcre/php_pcre.h
 #endif
 
-#include ext/standard/php_string.h
+#include ext/standard/php_string.h
+#include ext/date/php_date.h
 
-/*
-   extern int _daylight;
-   extern long _timezone;
- */
 /*enum
{
DO_CONNECT = WM_USER +1
};
  */
 
-static char *days[] =
-{Sun, Mon, Tue, Wed, Thu, Fri, Sat};
-static char *months[] =
-{Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, 
Dec};
-
 /* '*error_message' has to be passed around from php_mail() */
 #define SMTP_ERROR_RESPONSE_SPEC   SMTP server response: %s
 /* Convinient way to handle error messages from the SMTP server.
@@ -98,8 +90,6 @@
 char *php_mailer = PHP 4 NetWare;
 #endif /* NETWARE */
 
-char *get_header(char *h, char *headers);
-
 /* Error messages */
 static char *ErrorMessages[] =
 {
@@ -220,13 +210,12 @@
 ///
 PHPAPI int TSendMail(char *host, int *error, char **error_message,
  char *headers, char *Subject, char *mailTo, char 
*data,
- char *mailCc, char *mailBcc, char *mailRPath)
+ char *mailCc, char *mailBcc, char *mailRPath 
TSRMLS_DC)
 {
int ret;
char *RPath = NULL;
char *headers_lc = NULL; /* headers_lc is only created if we've a 
header at all */
char *pos1 = NULL, *pos2 = NULL;
-   TSRMLS_FETCH();
 
 #ifndef NETWARE
WinsockStarted = FALSE;
@@ -311,7 +300,7 @@
MailHost, !INI_INT(smtp_port) ? 25 : 
INI_INT(smtp_port));
return FAILURE;
} else {
-   ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, 
headers, headers_lc, error_message);
+   ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, 
headers, headers_lc, 

[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2005-04-08 Thread Ilia Alshanetsky
iliaa   Fri Apr  8 11:04:35 2005 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Missing part of the patch for bug #32589 
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.205r2=1.206ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.205 php-src/ext/imap/php_imap.c:1.206
--- php-src/ext/imap/php_imap.c:1.205   Tue Apr  5 10:47:47 2005
+++ php-src/ext/imap/php_imap.c Fri Apr  8 11:04:34 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.205 2005/04/05 14:47:47 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.206 2005/04/08 15:04:34 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3046,7 +3046,7 @@
convert_to_string_ex(pvalue);
tmp_param = mail_newbody_parameter();
tmp_param-value = (char *) 
fs_get(Z_STRLEN_PP(pvalue) + 1);
-   memcpy(disp_param-value, Z_STRVAL_PP(pvalue), 
Z_STRLEN_PP(pvalue) + 1);
+   memcpy(tmp_param-value, Z_STRVAL_PP(pvalue), 
Z_STRLEN_PP(pvalue) + 1);
tmp_param-attribute = CHARSET;
tmp_param-next = bod-parameter;
bod-parameter = tmp_param;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2005-04-05 Thread Ilia Alshanetsky
iliaa   Tue Apr  5 10:47:48 2005 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets).
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.204r2=1.205ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.204 php-src/ext/imap/php_imap.c:1.205
--- php-src/ext/imap/php_imap.c:1.204   Sun Feb 20 13:23:33 2005
+++ php-src/ext/imap/php_imap.c Tue Apr  5 10:47:47 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.204 2005/02/20 18:23:33 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.205 2005/04/05 14:47:47 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3045,7 +3045,8 @@
if (zend_hash_find(Z_ARRVAL_PP(data), charset, 
sizeof(charset), (void **) pvalue)== SUCCESS) {
convert_to_string_ex(pvalue);
tmp_param = mail_newbody_parameter();
-   tmp_param-value = cpystr(Z_STRVAL_PP(pvalue));
+   tmp_param-value = (char *) 
fs_get(Z_STRLEN_PP(pvalue) + 1);
+   memcpy(disp_param-value, Z_STRVAL_PP(pvalue), 
Z_STRLEN_PP(pvalue) + 1);
tmp_param-attribute = CHARSET;
tmp_param-next = bod-parameter;
bod-parameter = tmp_param;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2005-02-20 Thread Ilia Alshanetsky
iliaa   Sun Feb 20 13:23:34 2005 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Simplify Code.
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.203r2=1.204ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.203 php-src/ext/imap/php_imap.c:1.204
--- php-src/ext/imap/php_imap.c:1.203   Tue Jan 25 09:20:02 2005
+++ php-src/ext/imap/php_imap.c Sun Feb 20 13:23:33 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.203 2005/01/25 14:20:02 tony2001 Exp $ */
+/* $Id: php_imap.c,v 1.204 2005/02/20 18:23:33 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3169,8 +3169,7 @@
 
efree(tempstring);
} else {
-   mystring = emalloc(strlen(tmp) + 1);
-   strcpy(mystring, tmp);
+   mystring = estrdup(tmp);
}
 
bod = topbod;
@@ -3206,10 +3205,9 @@
 
/* output cookie, mini-header, and contents */

tempstring=emalloc(strlen(mystring)+strlen(tmp)+1);
-   strcpy(tempstring, mystring);
+   sprintf(tempstring, %s%s, mystring, tmp);
efree(mystring);
mystring=tempstring;
-   strcat(mystring, tmp);
 
bod=part-body;
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2005-01-25 Thread Antony Dovgal
tony2001Tue Jan 25 09:20:03 2005 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  check body for NULL before using and prevent segfaults
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.202r2=1.203ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.202 php-src/ext/imap/php_imap.c:1.203
--- php-src/ext/imap/php_imap.c:1.202   Fri Jan 21 05:55:41 2005
+++ php-src/ext/imap/php_imap.c Tue Jan 25 09:20:02 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.202 2005/01/21 10:55:41 tony2001 Exp $ */
+/* $Id: php_imap.c,v 1.203 2005/01/25 14:20:02 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -2653,6 +2653,10 @@
object_init(return_value);

body=mail_body(imap_le_struct-imap_stream, Z_LVAL_PP(msg), 
Z_STRVAL_PP(section));
+   if (body == NULL) {
+   zval_dtor(return_value);
+   RETURN_FALSE;
+   }
if (body-type = TYPEMAX) {
add_property_long(return_value, type, body-type);
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2005-01-21 Thread Antony Dovgal
tony2001Fri Jan 21 05:55:43 2005 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  destruct return_value
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.201r2=1.202ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.201 php-src/ext/imap/php_imap.c:1.202
--- php-src/ext/imap/php_imap.c:1.201   Thu Jan 20 13:08:08 2005
+++ php-src/ext/imap/php_imap.c Fri Jan 21 05:55:41 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.201 2005/01/20 18:08:08 tony2001 Exp $ */
+/* $Id: php_imap.c,v 1.202 2005/01/21 10:55:41 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -1027,6 +1027,7 @@
mail_parameters(NIL, SET_ACL, (void *) mail_getacl);
if(!imap_getacl(imap_le_struct-imap_stream, Z_STRVAL_PP(mailbox))) {
php_error(E_WARNING, c-client imap_getacl failed);
+   zval_dtor(return_value);
RETURN_FALSE;
}
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2005-01-20 Thread Antony Dovgal
tony2001Thu Jan 20 09:04:50 2005 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  fix segfault in imap_headerinfo() when fromlength or subjectlength are less 
than 0
  + fix protos
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.198r2=1.199ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.198 php-src/ext/imap/php_imap.c:1.199
--- php-src/ext/imap/php_imap.c:1.198   Tue Jan 18 18:36:08 2005
+++ php-src/ext/imap/php_imap.c Thu Jan 20 09:04:50 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.198 2005/01/18 23:36:08 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.199 2005/01/20 14:04:50 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -1525,12 +1525,20 @@
 
convert_to_long_ex(msgno);
if (myargc = 3) {
-   convert_to_long_ex(fromlength); 
+   convert_to_long_ex(fromlength);
+   if (Z_LVAL_PP(fromlength)  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, From 
length has to be greater than or equal to 0);
+   RETURN_FALSE;
+   }
} else {
fromlength = 0x00;
}
if (myargc = 4) {
convert_to_long_ex(subjectlength);
+   if (Z_LVAL_PP(subjectlength)  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Subject 
length has to be greater than or equal to 0);
+   RETURN_FALSE;   
+   }
} else {
subjectlength = 0x00;
}
@@ -1798,7 +1806,7 @@
 }
 /* }}} */
 
-/* {{{ proto string imap_fetchbody(resource stream_id, int msg_no, int section 
[, int options])
+/* {{{ proto string imap_fetchbody(resource stream_id, int msg_no, string 
section [, int options])
Get a specific body section */
 PHP_FUNCTION(imap_fetchbody)
 {
@@ -2612,7 +2620,7 @@
 }
 /* }}} */
 
-/* {{{ proto object imap_bodystruct(resource stream_id, int msg_no, int 
section)
+/* {{{ proto object imap_bodystruct(resource stream_id, int msg_no, string 
section)
Read the structure of a specified body section of a specific message */
 PHP_FUNCTION(imap_bodystruct)
 {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2005-01-20 Thread Antony Dovgal
tony2001Thu Jan 20 13:03:35 2005 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  fix segfault in imap_sort() - it segfaults when options is less than 0.
  it looks like c-client bug, but we still need a workaround.
  also, convert_to_string search criteria.
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.199r2=1.200ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.199 php-src/ext/imap/php_imap.c:1.200
--- php-src/ext/imap/php_imap.c:1.199   Thu Jan 20 09:04:50 2005
+++ php-src/ext/imap/php_imap.c Thu Jan 20 13:03:35 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.199 2005/01/20 14:04:50 tony2001 Exp $ */
+/* $Id: php_imap.c,v 1.200 2005/01/20 18:03:35 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -1537,7 +1537,7 @@
convert_to_long_ex(subjectlength);
if (Z_LVAL_PP(subjectlength)  0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Subject 
length has to be greater than or equal to 0);
-   RETURN_FALSE;   
+   RETURN_FALSE;
}
} else {
subjectlength = 0x00;
@@ -2467,8 +2467,13 @@
}
if (myargc = 4) {
convert_to_long_ex(flags);
+   if (Z_LVAL_PP(flags)  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Search 
options parameter has to be greater than or equal to 0cannot be less than 0);
+   RETURN_FALSE;
+   }
}
if (myargc = 5) {
+   convert_to_string_ex(criteria);
search_criteria = estrndup(Z_STRVAL_PP(criteria), 
Z_STRLEN_PP(criteria));
spg = mail_criteria(search_criteria);
efree(search_criteria);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2005-01-20 Thread Antony Dovgal
tony2001Thu Jan 20 13:08:08 2005 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  fix error message
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.200r2=1.201ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.200 php-src/ext/imap/php_imap.c:1.201
--- php-src/ext/imap/php_imap.c:1.200   Thu Jan 20 13:03:35 2005
+++ php-src/ext/imap/php_imap.c Thu Jan 20 13:08:08 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.200 2005/01/20 18:03:35 tony2001 Exp $ */
+/* $Id: php_imap.c,v 1.201 2005/01/20 18:08:08 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -2468,7 +2468,7 @@
if (myargc = 4) {
convert_to_long_ex(flags);
if (Z_LVAL_PP(flags)  0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Search 
options parameter has to be greater than or equal to 0cannot be less than 0);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Search 
options parameter has to be greater than or equal to 0);
RETURN_FALSE;
}
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2005-01-18 Thread Ilia Alshanetsky
iliaa   Tue Jan 18 11:32:54 2005 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed bug #31480 (Possible infinite loop in imap_mail_compose()).
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.196r2=1.197ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.196 php-src/ext/imap/php_imap.c:1.197
--- php-src/ext/imap/php_imap.c:1.196   Mon Jan 10 23:56:06 2005
+++ php-src/ext/imap/php_imap.c Tue Jan 18 11:32:53 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.196 2005/01/11 04:56:06 sniper Exp $ */
+/* $Id: php_imap.c,v 1.197 2005/01/18 16:32:53 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3089,7 +3089,7 @@
bod-contents.text.size = Z_STRLEN_PP(pvalue);
} else {
bod-contents.text.data = (char *) fs_get(1);
-   bod-contents.text.data = ;
+   memcpy(bod-contents.text.data, , 1);
bod-contents.text.size = 0;
}
if (zend_hash_find(Z_ARRVAL_PP(data), lines, 
sizeof(lines), (void **) pvalue)== SUCCESS) {
@@ -3104,9 +3104,8 @@
convert_to_string_ex(pvalue);
bod-md5 = cpystr(Z_STRVAL_PP(pvalue));
}
-
-   zend_hash_move_forward(Z_ARRVAL_PP(body));
}
+   zend_hash_move_forward(Z_ARRVAL_PP(body));
}
 
rfc822_encode_body_7bit(env, topbod); 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2005-01-18 Thread Ilia Alshanetsky
iliaa   Tue Jan 18 18:36:09 2005 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed bug #31142 (crash, memory leak and data loss by imap_mail_compose).
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.197r2=1.198ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.197 php-src/ext/imap/php_imap.c:1.198
--- php-src/ext/imap/php_imap.c:1.197   Tue Jan 18 11:32:53 2005
+++ php-src/ext/imap/php_imap.c Tue Jan 18 18:36:08 2005
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.197 2005/01/18 16:32:53 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.198 2005/01/18 23:36:08 iliaa Exp $ */
 
 #define IMAP41
 
@@ -57,7 +57,8 @@
 MAILSTREAM DEFAULTPROTO;
 #endif
 
-#define CRLF   \015\012
+#define CRLF\015\012
+#define CRLF_LEN sizeof(\015\012) - 1
 #define PHP_EXPUNGE 32768
 #define PHP_IMAP_ADDRESS_SIZE_BUF 10
 
@@ -3108,22 +3109,46 @@
zend_hash_move_forward(Z_ARRVAL_PP(body));
}
 
+   if (bod  bod-type == TYPEMULTIPART  (!bod-nested.part || 
!bod-nested.part-next)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, cannot generate 
multipart e-mail without components.);
+   RETVAL_FALSE;
+   goto done;
+   }
+
+   if (bod  bod-type == TYPEMULTIPART  (!bod-nested.part || 
!bod-nested.part-next)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, cannot generate 
multipart e-mail without components.);
+   RETVAL_FALSE;
+   goto done;
+   }
+
rfc822_encode_body_7bit(env, topbod); 
rfc822_header (tmp, env, topbod);
 
/* add custom envelope headers */
if (custom_headers_param) {
+   int l = strlen(tmp) - 2, l2;
+   PARAMETER *tp = custom_headers_param;
+
/* remove last CRLF from tmp */
-   tmp[strlen(tmp) - 2] = '\0';
-   tempstring = emalloc(strlen(tmp) + 1);
-   strcpy(tempstring, tmp);
+   tmp[l] = '\0';
+   tempstring = emalloc(l);
+   memcpy(tempstring, tmp, l);
+   
do {
-   tempstring = erealloc(tempstring, strlen(tempstring) + 
strlen(custom_headers_param-value) + strlen(CRLF) + 1);
-   sprintf(tempstring, %s%s%s, tempstring, 
custom_headers_param-value, CRLF);
+   l2 = strlen(custom_headers_param-value);
+   tempstring = erealloc(tempstring, l + l2 + CRLF_LEN + 
1);
+   memcpy(tempstring + l, custom_headers_param-value, l2);
+   memcpy(tempstring + l + l2, CRLF, CRLF_LEN);
+   l += l2 + CRLF_LEN;
} while ((custom_headers_param = custom_headers_param-next));
 
-   mystring = emalloc(strlen(tempstring) + strlen(CRLF) + 1);
-   sprintf(mystring, %s%s, tempstring, CRLF);
+   mail_free_body_parameter(tp);  
+
+   mystring = emalloc(l + CRLF_LEN + 1);
+   memcpy(mystring, tempstring, l);
+   memcpy(mystring + l , CRLF, CRLF_LEN);
+   mystring[l + CRLF_LEN] = '\0';
+
efree(tempstring);
} else {
mystring = emalloc(strlen(tmp) + 1);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-12-29 Thread Ilia Alshanetsky
iliaa   Wed Dec 29 16:25:00 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFB: don't perform pointless operations.
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.190r2=1.191ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.190 php-src/ext/imap/php_imap.c:1.191
--- php-src/ext/imap/php_imap.c:1.190   Wed Dec 22 12:27:39 2004
+++ php-src/ext/imap/php_imap.c Wed Dec 29 16:25:00 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.190 2004/12/22 17:27:39 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.191 2004/12/29 21:25:00 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3191,8 +3191,7 @@
RETURN_FALSE;
}
 
-   RETVAL_STRINGL(mystring, strlen(mystring), 1);  
-   efree(tempstring);
+   RETVAL_STRINGL(tempstring, 0);  
 }
 /* }}} */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-12-29 Thread Ilia Alshanetsky
iliaa   Wed Dec 29 16:33:04 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed memory leaks.
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.191r2=1.192ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.191 php-src/ext/imap/php_imap.c:1.192
--- php-src/ext/imap/php_imap.c:1.191   Wed Dec 29 16:25:00 2004
+++ php-src/ext/imap/php_imap.c Wed Dec 29 16:33:03 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.191 2004/12/29 21:25:00 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.192 2004/12/29 21:33:03 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3188,10 +3188,14 @@
mystring=tempstring;
} else {
efree(mystring);
-   RETURN_FALSE;
+   RETVAL_FALSE;
+   goto done;
}
 
-   RETVAL_STRINGL(tempstring, 0);  
+   RETVAL_STRINGL(tempstring, 0);
+done:
+   mail_free_body(topbod);
+   mail_free_envelope(env);
 }
 /* }}} */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-12-29 Thread Ilia Alshanetsky
iliaa   Wed Dec 29 16:56:43 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed typo.
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.192r2=1.193ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.192 php-src/ext/imap/php_imap.c:1.193
--- php-src/ext/imap/php_imap.c:1.192   Wed Dec 29 16:33:03 2004
+++ php-src/ext/imap/php_imap.c Wed Dec 29 16:56:42 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.192 2004/12/29 21:33:03 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.193 2004/12/29 21:56:42 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3192,7 +3192,7 @@
goto done;
}
 
-   RETVAL_STRINGL(tempstring, 0);
+   RETVAL_STRING(tempstring, 0);
 done:
mail_free_body(topbod);
mail_free_envelope(env);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-12-29 Thread Ilia Alshanetsky
iliaa   Wed Dec 29 23:39:17 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  MFH: A leak is better(?) then a crash.
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.193r2=1.194ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.193 php-src/ext/imap/php_imap.c:1.194
--- php-src/ext/imap/php_imap.c:1.193   Wed Dec 29 16:56:42 2004
+++ php-src/ext/imap/php_imap.c Wed Dec 29 23:39:17 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.193 2004/12/29 21:56:42 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.194 2004/12/30 04:39:17 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3194,7 +3194,9 @@
 
RETVAL_STRING(tempstring, 0);
 done:
+#if ilia_0 /* this should be done, otherwise we leak memory. Unfortunately 
this seems to cause a crash in some cases */
mail_free_body(topbod);
+#endif
mail_free_envelope(env);
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-12-29 Thread Jani Taskinen
sniper  Thu Dec 30 00:31:56 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - Fixed the crash and leak.
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.194r2=1.195ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.194 php-src/ext/imap/php_imap.c:1.195
--- php-src/ext/imap/php_imap.c:1.194   Wed Dec 29 23:39:17 2004
+++ php-src/ext/imap/php_imap.c Thu Dec 30 00:31:55 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.194 2004/12/30 04:39:17 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.195 2004/12/30 05:31:55 sniper Exp $ */
 
 #define IMAP41
 
@@ -2980,7 +2980,7 @@
bod-contents.text.size = Z_STRLEN_PP(pvalue);
} else {
bod-contents.text.data = (char *) fs_get(1);
-   bod-contents.text.data = ;
+   memcpy(bod-contents.text.data, , 1);
bod-contents.text.size = 0;
}
if (zend_hash_find(Z_ARRVAL_PP(data), lines, sizeof(lines), 
(void **) pvalue)== SUCCESS) {
@@ -3194,9 +3194,7 @@
 
RETVAL_STRING(tempstring, 0);
 done:
-#if ilia_0 /* this should be done, otherwise we leak memory. Unfortunately 
this seems to cause a crash in some cases */
mail_free_body(topbod);
-#endif
mail_free_envelope(env);
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-12-21 Thread Ilia Alshanetsky
iliaa   Tue Dec 21 10:47:14 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed possible crash in imap_mail_compose().
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.188r2=1.189ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.188 php-src/ext/imap/php_imap.c:1.189
--- php-src/ext/imap/php_imap.c:1.188   Thu Aug 12 15:31:36 2004
+++ php-src/ext/imap/php_imap.c Tue Dec 21 10:47:14 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.188 2004/08/12 19:31:36 chagenbu Exp $ */
+/* $Id: php_imap.c,v 1.189 2004/12/21 15:47:14 iliaa Exp $ */
 
 #define IMAP41
 
@@ -2978,6 +2978,10 @@
bod-contents.text.data = (char *) 
fs_get(Z_STRLEN_PP(pvalue) + 1);
memcpy(bod-contents.text.data, Z_STRVAL_PP(pvalue), 
Z_STRLEN_PP(pvalue)+1);
bod-contents.text.size = Z_STRLEN_PP(pvalue);
+   } else {
+   bod-contents.text.data = (char *) fs_get(1);
+   bod-contents.text.data = ;
+   bod-contents.text.size = 0;
}
if (zend_hash_find(Z_ARRVAL_PP(data), lines, sizeof(lines), 
(void **) pvalue)== SUCCESS) {
convert_to_long_ex(pvalue);
@@ -3081,6 +3085,10 @@
bod-contents.text.data = (char *) 
fs_get(Z_STRLEN_PP(pvalue) + 1);
memcpy(bod-contents.text.data, 
Z_STRVAL_PP(pvalue), Z_STRLEN_PP(pvalue) + 1);
bod-contents.text.size = Z_STRLEN_PP(pvalue);
+   } else {
+   bod-contents.text.data = (char *) fs_get(1);
+   bod-contents.text.data = ;
+   bod-contents.text.size = 0;
}
if (zend_hash_find(Z_ARRVAL_PP(data), lines, 
sizeof(lines), (void **) pvalue)== SUCCESS) {
convert_to_long_ex(pvalue);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-08-12 Thread Chuck Hagenbuch
chagenbuThu Aug 12 14:01:45 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  fix.
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.185r2=1.186ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.185 php-src/ext/imap/php_imap.c:1.186
--- php-src/ext/imap/php_imap.c:1.185   Wed Jul 21 17:57:03 2004
+++ php-src/ext/imap/php_imap.c Thu Aug 12 14:01:45 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.185 2004/07/21 21:57:03 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.186 2004/08/12 18:01:45 chagenbu Exp $ */
 
 #define IMAP41
 
@@ -1816,8 +1816,12 @@
if (myargc == 4) {
convert_to_long_ex(flags);
}
- 
-   PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
+
+if (myargc  4 || !Z_LVAL_PP(flags)  FT_UID) {
+/* If we're fetching via UID, checking the range of msgno is
+   DUMB. */
+PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
+}
  
body = mail_fetchbody_full(imap_le_struct-imap_stream, Z_LVAL_PP(msgno), 
Z_STRVAL_PP(sec), len, myargc==4 ? Z_LVAL_PP(flags) : NIL);
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-08-12 Thread Derick Rethans
On Thu, 12 Aug 2004, Chuck Hagenbuch wrote:

 chagenbu  Thu Aug 12 14:01:45 2004 EDT

   Modified files:
 /php-src/ext/imap php_imap.c
   Log:
   fix.

Allways say what you fix, and please fix the whitespace!

Derick

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-08-12 Thread Chuck Hagenbuch
Quoting Derick Rethans [EMAIL PROTECTED]:
chagenbuThu Aug 12 14:01:45 2004 EDT
  Modified files:
/php-src/ext/imap   php_imap.c
  Log:
  fix.
Allways say what you fix, and please fix the whitespace!
Christ. I was just fixing Ilia's bug that no one was willing to do crap 
about. I
haven't committed anything to php-src in years now and damned if I care about
the whitespace.

Give respect, get respect. Act like an ass, well, then I'll fix what I 
can how I
can.

-chuck
--
Regard my poor demoralized mule! - Juan Valdez
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-08-12 Thread Wez Furlong
*boggle*

Come on Chuck, there are coding standards for a reason.
There is never a rush to commit.

Stuff breaks in CVS, then it gets fixed.  Jans original email was only
sent 7 hours ago; the way you guys are acting is as though it's been
broken for months with no one listening to your patient requests.

--Wez.

On Thu, 12 Aug 2004 14:44:36 -0400, Chuck Hagenbuch [EMAIL PROTECTED] wrote:
 Quoting Derick Rethans [EMAIL PROTECTED]:
 
  chagenbu Thu Aug 12 14:01:45 2004 EDT
 
Modified files:
  /php-src/ext/imapphp_imap.c
Log:
fix.
 
  Allways say what you fix, and please fix the whitespace!
 
 Christ. I was just fixing Ilia's bug that no one was willing to do crap
 about. I
 haven't committed anything to php-src in years now and damned if I care about
 the whitespace.
 
 Give respect, get respect. Act like an ass, well, then I'll fix what I
 can how I
 can.

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-08-12 Thread Derick Rethans
On Thu, 12 Aug 2004, Chuck Hagenbuch wrote:

 Quoting Derick Rethans [EMAIL PROTECTED]:

  chagenbu   Thu Aug 12 14:01:45 2004 EDT
 
Modified files:
  /php-src/ext/imap  php_imap.c
Log:
fix.
 
  Allways say what you fix, and please fix the whitespace!

 Christ. I was just fixing Ilia's bug that no one was willing to do
 crap about. I haven't committed anything to php-src in years now and
 damned if I care about the whitespace.

1. Wez was pissed that Jan was wining, we are all busy and sometimes it
   just takes some time before things are taken care of.
2. It doesn't mean jackass if you didn't commit in years, you still
   respect guidelines, if not: don't bother committing.

 Give respect, get respect. Act like an ass, well, then I'll fix what I
 can how I can.

3. Look at yourself before calling somebody else an ass.

Derick

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-08-12 Thread Ilia Alshanetsky
iliaa   Thu Aug 12 15:20:15 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Properly fix the msgno check inside imap_fetchbody().
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.186r2=1.187ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.186 php-src/ext/imap/php_imap.c:1.187
--- php-src/ext/imap/php_imap.c:1.186   Thu Aug 12 14:01:45 2004
+++ php-src/ext/imap/php_imap.c Thu Aug 12 15:20:15 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.186 2004/08/12 18:01:45 chagenbu Exp $ */
+/* $Id: php_imap.c,v 1.187 2004/08/12 19:20:15 iliaa Exp $ */
 
 #define IMAP41
 
@@ -1817,11 +1817,11 @@
convert_to_long_ex(flags);
}
 
-if (myargc  4 || !Z_LVAL_PP(flags)  FT_UID) {
-/* If we're fetching via UID, checking the range of msgno is
-   DUMB. */
-PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
-}
+   if (myargc  4 || !(Z_LVAL_PP(flags)  FT_UID)) {
+   /* only perform the check if the msgno is a message number and not a 
UID */
+   PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
+   }
+ 
  
body = mail_fetchbody_full(imap_le_struct-imap_stream, Z_LVAL_PP(msgno), 
Z_STRVAL_PP(sec), len, myargc==4 ? Z_LVAL_PP(flags) : NIL);
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-08-12 Thread Ilia Alshanetsky
On August 12, 2004 02:44 pm, Chuck Hagenbuch wrote:
 Christ. I was just fixing Ilia's bug that no one was willing to do crap
 about.

I don't know where about you are located, but where I am at, right now it is 
the middle of a business day. Which means most people (myself included) are 
working on paid projects and not PHP stuff. That said I have seen the report 
and was going to look at it this evening. Release candidates that both Andi 
and I release are made for the explicit purpose of detecting these problems.

While Tony and I did not anticipate the problem you reported, this is no 
reason to whine and throw blame around. Your very own hastily thrown fix 
had a bug in it.

 I 
 haven't committed anything to php-src in years now and damned if I care
 about the whitespace.

Given that you're commit is mere 4 lines, surely you could take 30 seconds and 
make sure it resembles readable code, no?


 Give respect, get respect. Act like an ass, well, then I'll fix what I
 can how I
 can.

Indeed.

Ilia

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-08-12 Thread Chuck Hagenbuch
chagenbuThu Aug 12 15:31:36 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  More spaces - tabs.
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.187r2=1.188ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.187 php-src/ext/imap/php_imap.c:1.188
--- php-src/ext/imap/php_imap.c:1.187   Thu Aug 12 15:20:15 2004
+++ php-src/ext/imap/php_imap.c Thu Aug 12 15:31:36 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.187 2004/08/12 19:20:15 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.188 2004/08/12 19:31:36 chagenbu Exp $ */
 
 #define IMAP41
 
@@ -112,7 +112,7 @@
PHP_FE(imap_qprint,
 NULL)
PHP_FE(imap_8bit,  
 NULL)
PHP_FE(imap_binary,
 NULL)
-   PHP_FE(imap_utf8,   NULL)
+   PHP_FE(imap_utf8,  
 NULL)
PHP_FE(imap_status,
 NULL)
PHP_FE(imap_mailboxmsginfo, NULL)
PHP_FE(imap_setflag_full,   NULL)
@@ -137,18 +137,18 @@
PHP_FE(imap_get_quota,  NULL)
PHP_FE(imap_get_quotaroot,  NULL)
PHP_FE(imap_set_quota,  NULL)
-   PHP_FE(imap_setacl,
 NULL)
-   PHP_FE(imap_getacl,
 NULL)
+   PHP_FE(imap_setacl,
 NULL)
+   PHP_FE(imap_getacl,
 NULL)
 #endif
 
PHP_FE(imap_mail,  
 NULL)
 
-   PHP_FALIAS(imap_header, imap_headerinfo,NULL)
-   PHP_FALIAS(imap_listmailbox,imap_list,  NULL)
-   PHP_FALIAS(imap_getmailboxes,   imap_list_full, NULL)
-   PHP_FALIAS(imap_scanmailbox,imap_listscan,  NULL)
-   PHP_FALIAS(imap_listsubscribed, imap_lsub,  NULL)
-   PHP_FALIAS(imap_getsubscribed,  imap_lsub_full, NULL)
+   PHP_FALIAS(imap_header, imap_headerinfo,NULL)
+   PHP_FALIAS(imap_listmailbox,imap_list,  NULL)
+   PHP_FALIAS(imap_getmailboxes,   imap_list_full, NULL)
+   PHP_FALIAS(imap_scanmailbox,imap_listscan,  NULL)
+   PHP_FALIAS(imap_listsubscribed, imap_lsub,  NULL)
+   PHP_FALIAS(imap_getsubscribed,  imap_lsub_full, NULL)
PHP_FALIAS(imap_fetchtext,  imap_body,  NULL)
PHP_FALIAS(imap_scan,   imap_listscan,  NULL)
PHP_FALIAS(imap_create, imap_createmailbox, NULL)
@@ -1821,8 +1821,7 @@
/* only perform the check if the msgno is a message number and not a 
UID */
PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
}
- 
- 
+
body = mail_fetchbody_full(imap_le_struct-imap_stream, Z_LVAL_PP(msgno), 
Z_STRVAL_PP(sec), len, myargc==4 ? Z_LVAL_PP(flags) : NIL);
 
if (!body) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-07-21 Thread Ilia Alshanetsky
iliaa   Wed Jul 21 17:57:03 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed bug #29209 (imap_fetchbody() doesn't check message index).
  
  # Initial Patch by tony2001 at phpclub dot net
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.184r2=1.185ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.184 php-src/ext/imap/php_imap.c:1.185
--- php-src/ext/imap/php_imap.c:1.184   Sun Jul  4 12:52:59 2004
+++ php-src/ext/imap/php_imap.c Wed Jul 21 17:57:03 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.184 2004/07/04 16:52:59 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.185 2004/07/21 21:57:03 iliaa Exp $ */
 
 #define IMAP41
 
@@ -182,6 +182,12 @@
 /* True globals, no need for thread safety */
 static int le_imap;
 
+#define PHP_IMAP_CHECK_MSGNO(msgindex) \
+   if ((msgindex  1) || ((unsigned) msgindex  
imap_le_struct-imap_stream-nmsgs)) { \
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Bad message number); 
 \
+   RETURN_FALSE;   \
+   }   \
+
 /* {{{ mail_close_it
  */
 static void mail_close_it(zend_rsrc_list_entry *rsrc TSRMLS_DC)
@@ -1529,11 +1535,8 @@
convert_to_string_ex(defaulthost);
}

-   if (!Z_LVAL_PP(msgno) || Z_LVAL_PP(msgno)  1 || (unsigned) Z_LVAL_PP(msgno)  
imap_le_struct-imap_stream-nmsgs) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Bad message number);
-   RETURN_FALSE;
-   }
-   
+   PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
+
if (mail_fetchstructure(imap_le_struct-imap_stream, Z_LVAL_PP(msgno), NIL)) {
cache = mail_elt(imap_le_struct-imap_stream, Z_LVAL_PP(msgno));
} else {
@@ -1779,10 +1782,7 @@
} else {
msgindex = Z_LVAL_PP(msgno);
}
-   if ((msgindex  1) || ((unsigned) msgindex  
imap_le_struct-imap_stream-nmsgs)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Bad message number);
-   RETURN_FALSE;
-   }
+   PHP_IMAP_CHECK_MSGNO(msgindex);
 
mail_fetchstructure_full(imap_le_struct-imap_stream, Z_LVAL_PP(msgno), body 
, myargc == 3 ? Z_LVAL_PP(flags) : NIL);

@@ -1817,6 +1817,8 @@
convert_to_long_ex(flags);
}
  
+   PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
+ 
body = mail_fetchbody_full(imap_le_struct-imap_stream, Z_LVAL_PP(msgno), 
Z_STRVAL_PP(sec), len, myargc==4 ? Z_LVAL_PP(flags) : NIL);
 
if (!body) {
@@ -2512,10 +2514,7 @@
msgindex = Z_LVAL_PP(msgno);
}
 
-   if ((msgindex  1) || ((unsigned) msgindex  
imap_le_struct-imap_stream-nmsgs)) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Bad message number);
-   RETURN_FALSE;
-   }
+   PHP_IMAP_CHECK_MSGNO(msgindex);
 
RETVAL_STRING(mail_fetchheader_full(imap_le_struct-imap_stream, 
Z_LVAL_PP(msgno), NIL, NIL, (myargc == 3 ? Z_LVAL_PP(flags) : NIL)), 1);
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-07-04 Thread Ilia Alshanetsky
iliaa   Sun Jul  4 12:52:59 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed bug #28963 (Missing space for \0 in address allocation).
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.183r2=1.184ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.183 php-src/ext/imap/php_imap.c:1.184
--- php-src/ext/imap/php_imap.c:1.183   Wed May 12 16:17:19 2004
+++ php-src/ext/imap/php_imap.c Sun Jul  4 12:52:59 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.183 2004/05/12 20:17:19 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.184 2004/07/04 16:52:59 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3708,7 +3708,7 @@
addresstmp = addresslist;
 
if ((len = _php_imap_address_size(addresstmp))) {
-   tmpstr = (char *) malloc (len);
+   tmpstr = (char *) malloc(len + 1);
tmpstr[0] = '\0';
rfc822_write_address(tmpstr, addresstmp);
*fulladdress = tmpstr;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-05-12 Thread Ilia Alshanetsky
iliaa   Wed May 12 16:17:19 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed various possible memory leaks.
  
  
http://cvs.php.net/diff.php/php-src/ext/imap/php_imap.c?r1=1.182r2=1.183ty=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.182 php-src/ext/imap/php_imap.c:1.183
--- php-src/ext/imap/php_imap.c:1.182   Wed Jan 14 19:35:04 2004
+++ php-src/ext/imap/php_imap.c Wed May 12 16:17:19 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.182 2004/01/15 00:35:04 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.183 2004/05/12 20:17:19 iliaa Exp $ */
 
 #define IMAP41
 
@@ -1666,9 +1666,7 @@
 
convert_to_string_ex(ref);
convert_to_string_ex(pat);
-   
-   delim = safe_emalloc(2, sizeof(char), 0);
-   
+
/* set flag for new, improved array of objects list */
IMAPG(folderlist_style) = FLIST_OBJECT;

@@ -1679,6 +1677,7 @@
}

array_init(return_value);
+   delim = safe_emalloc(2, sizeof(char), 0);
cur=IMAPG(imap_sfolder_objects);
while (cur != NIL) {
MAKE_STD_ZVAL(mboxob);
@@ -3222,6 +3221,9 @@
bufferLen += strlen(cc) + 6;
}
 
+#define PHP_IMAP_CLEAN if (bufferTo) efree(bufferTo); if (bufferCc) efree(bufferCc); 
if (bufferBcc) efree(bufferBcc); if (bufferHeader) efree(bufferHeader);
+#define PHP_IMAP_BAD_DEST PHP_IMAP_CLEAN; efree(tempMailTo); return 
(BAD_MSG_DESTINATION);
+
bufferHeader = (char *)emalloc(bufferLen);
memset(bufferHeader, 0, bufferLen);
if (to  *to) {
@@ -3234,9 +3236,9 @@
addr = NULL;
rfc822_parse_adrlist(addr, tempMailTo, NULL);
while (addr) {
-   if (strcmp(addr-host, ERRHOST) == 0)
-   return (BAD_MSG_DESTINATION);
-   else {
+   if (strcmp(addr-host, ERRHOST) == 0) {
+   PHP_IMAP_BAD_DEST;
+   } else {
offset += sprintf(bufferTo + offset, [EMAIL 
PROTECTED],, addr-mailbox, addr-host);
}
addr = addr-next;
@@ -3257,9 +3259,9 @@
addr = NULL;
rfc822_parse_adrlist(addr, tempMailTo, NULL);
while (addr) {
-   if (strcmp(addr-host, ERRHOST) == 0)
-   return (BAD_MSG_DESTINATION);
-   else {
+   if (strcmp(addr-host, ERRHOST) == 0) {
+   PHP_IMAP_BAD_DEST;
+   } else {
offset += sprintf(bufferCc + offset, [EMAIL 
PROTECTED],, addr-mailbox, addr-host);
}
addr = addr-next;
@@ -3277,9 +3279,9 @@
addr = NULL;
rfc822_parse_adrlist(addr, tempMailTo, NULL);
while (addr) {
-   if (strcmp(addr-host, ERRHOST) == 0)
-   return (BAD_MSG_DESTINATION);
-   else {
+   if (strcmp(addr-host, ERRHOST) == 0) {
+   PHP_IMAP_BAD_DEST;
+   } else {
offset += sprintf(bufferBcc + offset, [EMAIL 
PROTECTED],, addr-mailbox, addr-host);
}
addr = addr-next;
@@ -3301,20 +3303,10 @@
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, %s, 
GetSMErrorText(tsm_err));
}
+   PHP_IMAP_CLEAN;
return 0;
}
-   if (bufferTo) {
-   efree(bufferTo);
-   }
-   if (bufferCc) {
-   efree(bufferCc);
-   }
-   if (bufferBcc) {
-   efree(bufferBcc);
-   }
-   if (bufferHeader) {
-   efree(bufferHeader);
-   }
+   PHP_IMAP_CLEAN;
 #else
if (!INI_STR(sendmail_path)) {
return 0;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-01-14 Thread Andi Gutmans
andiWed Jan 14 03:50:03 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  - Remove use of bogus macro
  
  
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.180 php-src/ext/imap/php_imap.c:1.181
--- php-src/ext/imap/php_imap.c:1.180   Thu Jan  8 03:15:48 2004
+++ php-src/ext/imap/php_imap.c Wed Jan 14 03:50:02 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.180 2004/01/08 08:15:48 andi Exp $ */
+/* $Id: php_imap.c,v 1.181 2004/01/14 08:50:02 andi Exp $ */
 
 #define IMAP41
 
@@ -2131,7 +2131,9 @@
ZEND_WRONG_PARAM_COUNT();
}

-   convert_to_writable_string_ex(arg); /* Is this string really 
modified? */
+   convert_to_string_ex(arg);  /*  Is this string really modified?
+   If it 
is use and you don't want it to be seen outside of the function
+   then 
use zend_get_parameters() */
 
in = (const unsigned char *) Z_STRVAL_PP(arg);
inlen = Z_STRLEN_PP(arg);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-01-14 Thread Ilia Alshanetsky
iliaa   Wed Jan 14 19:35:05 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Fixed bug #26909 (crash in imap_mime_header_decode() when no encoding is 
  used).
  
  
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.181 php-src/ext/imap/php_imap.c:1.182
--- php-src/ext/imap/php_imap.c:1.181   Wed Jan 14 03:50:02 2004
+++ php-src/ext/imap/php_imap.c Wed Jan 14 19:35:04 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.181 2004/01/14 08:50:02 andi Exp $ */
+/* $Id: php_imap.c,v 1.182 2004/01/15 00:35:04 iliaa Exp $ */
 
 #define IMAP41
 
@@ -3607,8 +3607,12 @@
add_property_string(myobject, charset, 
charset, 1);
add_property_string(myobject, text, decode, 
1);

zend_hash_next_index_insert(Z_ARRVAL_P(return_value), (void *)myobject, sizeof(zval 
*), NULL);
-   fs_give((void**)decode);
-   
+
+   /* only free decode if it was allocated by 
rfc822_qprint or rfc822_base64 */
+   if (decode != text) {
+   fs_give((void**)decode);
+   }
+
offset = end_token+2;
for (i = 0; (string[offset + i] == ' ') || 
(string[offset + i] == 0x0a) || (string[offset + i] == 0x0d); i++);
if ((string[offset + i] == '=')  
(string[offset + i + 1] == '?')  (offset + i  end)) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2004-01-07 Thread Jani Taskinen
sniper  Wed Jan  7 20:01:40 2004 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Added missing constants (bug #26831)
  
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.178 php-src/ext/imap/php_imap.c:1.179
--- php-src/ext/imap/php_imap.c:1.178   Thu Nov 13 15:55:00 2003
+++ php-src/ext/imap/php_imap.c Wed Jan  7 20:01:39 2004
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.178 2003/11/13 20:55:00 rasmus Exp $ */
+/* $Id: php_imap.c,v 1.179 2004/01/08 01:01:39 sniper Exp $ */
 
 #define IMAP41
 
@@ -567,6 +567,17 @@
REGISTER_LONG_CONSTANT(LATT_MARKED, LATT_MARKED, CONST_PERSISTENT | 
CONST_CS);
REGISTER_LONG_CONSTANT(LATT_UNMARKED, LATT_UNMARKED , CONST_PERSISTENT | 
CONST_CS);
 
+#ifdef LATT_REFERRAL
+   REGISTER_LONG_CONSTANT(LATT_REFERRAL, LATT_REFERRAL, CONST_PERSISTENT | 
CONST_CS);
+#endif
+
+#ifdef LATT_HASCHILDREN
+   REGISTER_LONG_CONSTANT(LATT_HASCHILDREN, LATT_HASCHILDREN, CONST_PERSISTENT 
| CONST_CS);
+#endif
+
+#ifdef LATT_HASNOCHILDREN
+   REGISTER_LONG_CONSTANT(LATT_HASNOCHILDREN, LATT_HASNOCHILDREN, 
CONST_PERSISTENT | CONST_CS);
+#endif
 
/* Sort functions */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2003-11-13 Thread Rasmus Lerdorf
rasmus  Thu Nov 13 15:55:01 2003 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  proto fix
  
  
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.177 php-src/ext/imap/php_imap.c:1.178
--- php-src/ext/imap/php_imap.c:1.177   Tue Sep 16 15:44:38 2003
+++ php-src/ext/imap/php_imap.c Thu Nov 13 15:55:00 2003
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.177 2003/09/16 19:44:38 hholzgra Exp $ */
+/* $Id: php_imap.c,v 1.178 2003/11/13 20:55:00 rasmus Exp $ */
 
 #define IMAP41
 
@@ -983,7 +983,7 @@
 /* }}} */
 
 
-/* {{{ proto array imap_getacl(int stream_id, string mailbox)
+/* {{{ proto array imap_getacl(resource stream_id, string mailbox)
Gets the ACL for a given mailbox */
 PHP_FUNCTION(imap_getacl)
 {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2003-09-16 Thread Hartmut Holzgraefe
hholzgraTue Sep 16 15:44:39 2003 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  proto fix
  
  
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.176 php-src/ext/imap/php_imap.c:1.177
--- php-src/ext/imap/php_imap.c:1.176   Thu Sep  4 03:47:58 2003
+++ php-src/ext/imap/php_imap.c Tue Sep 16 15:44:38 2003
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.176 2003/09/04 07:47:58 jon Exp $ */
+/* $Id: php_imap.c,v 1.177 2003/09/16 19:44:38 hholzgra Exp $ */
 
 #define IMAP41
 
@@ -983,7 +983,7 @@
 /* }}} */
 
 
-/* {{{ proto array imap_get_quota(int stream_id, string mailbox)
+/* {{{ proto array imap_getacl(int stream_id, string mailbox)
Gets the ACL for a given mailbox */
 PHP_FUNCTION(imap_getacl)
 {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/imap php_imap.c

2003-09-04 Thread Jon Parise
jon Thu Sep  4 03:47:59 2003 EDT

  Modified files:  
/php-src/ext/imap   php_imap.c 
  Log:
  Register the TYPEMODEL constant from c-client's mail.h.
  
  
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.175 php-src/ext/imap/php_imap.c:1.176
--- php-src/ext/imap/php_imap.c:1.175   Thu Aug 28 15:17:33 2003
+++ php-src/ext/imap/php_imap.c Thu Sep  4 03:47:58 2003
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski [EMAIL PROTECTED]   |
+--+
  */
-/* $Id: php_imap.c,v 1.175 2003/08/28 19:17:33 iliaa Exp $ */
+/* $Id: php_imap.c,v 1.176 2003/09/04 07:47:58 jon Exp $ */
 
 #define IMAP41
 
@@ -592,6 +592,7 @@
REGISTER_LONG_CONSTANT(TYPEAUDIO, TYPEAUDIO , CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT(TYPEIMAGE, TYPEIMAGE , CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT(TYPEVIDEO, TYPEVIDEO , CONST_PERSISTENT | CONST_CS);
+   REGISTER_LONG_CONSTANT(TYPEMODEL, TYPEMODEL , CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT(TYPEOTHER, TYPEOTHER , CONST_PERSISTENT | CONST_CS);
/*
TYPETEXTunformatted text
@@ -601,6 +602,7 @@
TYPEAUDIO   audio
TYPEIMAGE   static image (GIF, JPEG, etc.)
TYPEVIDEO   video
+   TYPEMODEL   model
TYPEOTHER   unknown
*/
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php