Jesse
2008-03-12 08:25:03 UTC
請教各位,
在我確定系統上的PHP有安全問題後,我該如何更新Patch?
例如,已得知相關參考URL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.63.2.23.2.2&r2=1.63.2.23.2.3&view=patch
連結上去後看到如下的頁面資料:
請問,接下來我該如何進行Patch修補的動作?及如何驗證是否已Patch完成了呢?
謝謝大家.
--- html.c 2006/02/25 21:33:06 1.63.2.23.2.2
+++ html.c 2006/11/01 01:56:46 1.63.2.23.2.3
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: html.c,v 1.63.2.23.2.2 2006/02/25 21:33:06 rasmus Exp $ */
+/* $Id: html.c,v 1.63.2.23.2.3 2006/11/01 01:56:46 iliaa Exp $ */
/*
* HTML entity resources:
@@ -878,7 +878,7 @@
matches_map = 0;
- if (len + 9 > maxlen)
+ if (len + 16 > maxlen)
replaced = erealloc (replaced, maxlen += 128);
if (all) {
@@ -903,9 +903,15 @@
}
if (matches_map) {
+ int l = strlen(rep);
+ /* increase the buffer size */
+ if (len + 2 + l >= maxlen) {
+ replaced = erealloc(replaced, maxlen += 128);
+ }
+
replaced[len++] = '&';
strcpy(replaced + len, rep);
- len += strlen(rep);
+ len += l;
replaced[len++] = ';';
}
}
--
[1;32m※ Origin: [33mSayYA 資訊站 [37m<bbs.sayya.org> [m
[1;31m◆ From: [36m59-120-223-59.hinet-ip.hinet.net[m
在我確定系統上的PHP有安全問題後,我該如何更新Patch?
例如,已得知相關參考URL
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.63.2.23.2.2&r2=1.63.2.23.2.3&view=patch
連結上去後看到如下的頁面資料:
請問,接下來我該如何進行Patch修補的動作?及如何驗證是否已Patch完成了呢?
謝謝大家.
--- html.c 2006/02/25 21:33:06 1.63.2.23.2.2
+++ html.c 2006/11/01 01:56:46 1.63.2.23.2.3
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: html.c,v 1.63.2.23.2.2 2006/02/25 21:33:06 rasmus Exp $ */
+/* $Id: html.c,v 1.63.2.23.2.3 2006/11/01 01:56:46 iliaa Exp $ */
/*
* HTML entity resources:
@@ -878,7 +878,7 @@
matches_map = 0;
- if (len + 9 > maxlen)
+ if (len + 16 > maxlen)
replaced = erealloc (replaced, maxlen += 128);
if (all) {
@@ -903,9 +903,15 @@
}
if (matches_map) {
+ int l = strlen(rep);
+ /* increase the buffer size */
+ if (len + 2 + l >= maxlen) {
+ replaced = erealloc(replaced, maxlen += 128);
+ }
+
replaced[len++] = '&';
strcpy(replaced + len, rep);
- len += strlen(rep);
+ len += l;
replaced[len++] = ';';
}
}
--
[1;32m※ Origin: [33mSayYA 資訊站 [37m<bbs.sayya.org> [m
[1;31m◆ From: [36m59-120-223-59.hinet-ip.hinet.net[m