r59897 - in /branches/upstream/libhtml-template-pro-perl/current: Changes META.yml README expr.c expr.y exprpstr.h exprpstr.inc exprtool.h lib/HTML/Template/Pro.pm perl-HTML-Template-Pro.spec

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Mon Jun 28 15:58:19 UTC 2010


Author: gregoa
Date: Mon Jun 28 15:58:11 2010
New Revision: 59897

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=59897
Log:
[svn-upgrade] new version libhtml-template-pro-perl (0.9502)

Modified:
    branches/upstream/libhtml-template-pro-perl/current/Changes
    branches/upstream/libhtml-template-pro-perl/current/META.yml
    branches/upstream/libhtml-template-pro-perl/current/README
    branches/upstream/libhtml-template-pro-perl/current/expr.c
    branches/upstream/libhtml-template-pro-perl/current/expr.y
    branches/upstream/libhtml-template-pro-perl/current/exprpstr.h
    branches/upstream/libhtml-template-pro-perl/current/exprpstr.inc
    branches/upstream/libhtml-template-pro-perl/current/exprtool.h
    branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm
    branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec

Modified: branches/upstream/libhtml-template-pro-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/Changes?rev=59897&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/Changes (original)
+++ branches/upstream/libhtml-template-pro-perl/current/Changes Mon Jun 28 15:58:11 2010
@@ -290,3 +290,6 @@
 	- bugfix release: segfault in EXPR log subroutine.
 	thanks to Robert Hanniger and Mike Shogin
 
+09502 Fri Jun 18 18:02:28 EEST 2010
+	- bugfix release: segfault for string operetions
+	with undefined variables. Thanks to Mike Shogin.

Modified: branches/upstream/libhtml-template-pro-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/META.yml?rev=59897&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/META.yml (original)
+++ branches/upstream/libhtml-template-pro-perl/current/META.yml Mon Jun 28 15:58:11 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               HTML-Template-Pro
-version:            0.9501
+version:            0.9502
 abstract:           Perl/XS module to use HTML Templates from CGI scripts
 author:
     - I. Yu. Vlasenko <viy at altlinux.org>

Modified: branches/upstream/libhtml-template-pro-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/README?rev=59897&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/README (original)
+++ branches/upstream/libhtml-template-pro-perl/current/README Mon Jun 28 15:58:11 2010
@@ -1,4 +1,4 @@
-HTML-Template-Pro version 0.9501
+HTML-Template-Pro version 0.9502
 ==============================
 
 DESCRIPTION

Modified: branches/upstream/libhtml-template-pro-perl/current/expr.c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/expr.c?rev=59897&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/expr.c (original)
+++ branches/upstream/libhtml-template-pro-perl/current/expr.c Mon Jun 28 15:58:11 2010
@@ -1875,14 +1875,14 @@
 
 /* Line 1455 of yacc.c  */
 #line 219 "expr.y"
-    { DO_TXTOP((yyval.numval),re_like,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),state);}
+    { DO_TXTOPLOG((yyval.numval),re_like,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),exprobj);}
     break;
 
   case 38:
 
 /* Line 1455 of yacc.c  */
 #line 220 "expr.y"
-    { DO_TXTOP((yyval.numval),re_notlike,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),state);}
+    { DO_TXTOPLOG((yyval.numval),re_notlike,(yyvsp[(1) - (3)].numval),(yyvsp[(3) - (3)].numval),exprobj);}
     break;
 
   case 39:

Modified: branches/upstream/libhtml-template-pro-perl/current/expr.y
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/expr.y?rev=59897&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/expr.y (original)
+++ branches/upstream/libhtml-template-pro-perl/current/expr.y Mon Jun 28 15:58:11 2010
@@ -216,8 +216,8 @@
 | numEXP strEQ numEXP 		{ DO_TXTOP($$,pstring_eq,$1,$3,state);}
 | numEXP strGT numEXP		{ DO_TXTOP($$,pstring_gt,$1,$3,state);}
 | numEXP strLT numEXP		{ DO_TXTOP($$,pstring_lt,$1,$3,state);}
-| numEXP reLIKE numEXP		{ DO_TXTOP($$,re_like,$1,$3,state);}
-| numEXP reNOTLIKE numEXP	{ DO_TXTOP($$,re_notlike,$1,$3,state);}
+| numEXP reLIKE numEXP		{ DO_TXTOPLOG($$,re_like,$1,$3,exprobj);}
+| numEXP reNOTLIKE numEXP	{ DO_TXTOPLOG($$,re_notlike,$1,$3,exprobj);}
 ;
 
 arglist: EXTFUNC '(' numEXP 	 	{

Modified: branches/upstream/libhtml-template-pro-perl/current/exprpstr.h
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/exprpstr.h?rev=59897&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/exprpstr.h (original)
+++ branches/upstream/libhtml-template-pro-perl/current/exprpstr.h Mon Jun 28 15:58:11 2010
@@ -29,8 +29,8 @@
 int pstring_lt(PSTRING, PSTRING);
 
 static
-int re_like(PSTRING, PSTRING);
+int re_like(struct expr_parser* exprobj, PSTRING, PSTRING);
 static
-int re_notlike(PSTRING, PSTRING);
+int re_notlike(struct expr_parser* exprobj, PSTRING, PSTRING);
 
 #endif /* exprpstr.h */

Modified: branches/upstream/libhtml-template-pro-perl/current/exprpstr.inc
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/exprpstr.inc?rev=59897&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/exprpstr.inc (original)
+++ branches/upstream/libhtml-template-pro-perl/current/exprpstr.inc Mon Jun 28 15:58:11 2010
@@ -53,6 +53,8 @@
 pstring_ge(PSTRING a, PSTRING b) {
   const char* in_a=a.begin;
   const char* in_b=b.begin;
+  if (in_b==NULL) return 1;
+  if (in_a==NULL) return 0;
   while (in_a<a.endnext && in_b < b.endnext && *in_a++==*in_b++);
   if ((in_a==a.endnext && in_b==b.endnext) || *(--in_a) >= *(--in_b) ) return 1; else return 0;
 }
@@ -62,6 +64,8 @@
 pstring_le(PSTRING a, PSTRING b) {
   const char* in_a=a.begin;
   const char* in_b=b.begin;
+  if (in_a==NULL) return 1;
+  if (in_b==NULL) return 0;
   while (in_a<a.endnext && in_b < b.endnext && *in_a++==*in_b++);
   if ((in_a==a.endnext && in_b==b.endnext) || *(--in_a) <= *(--in_b) ) return 1; else return 0;
 }
@@ -71,6 +75,7 @@
 pstring_ne(PSTRING a, PSTRING b) {
   const char* in_a=a.begin;
   const char* in_b=b.begin;
+  if (in_a==NULL || in_b==NULL) return in_a != in_b;
   while (in_a<a.endnext && in_b < b.endnext && *in_a++==*in_b++);
   if (in_a==a.endnext && in_b==b.endnext && *(--in_a) == *(--in_b)) return 0; else return 1;
 }
@@ -80,6 +85,7 @@
 pstring_eq(PSTRING a, PSTRING b) {
   const char* in_a=a.begin;
   const char* in_b=b.begin;
+  if (in_a==NULL || in_b==NULL) return in_a == in_b;
   while (in_a<a.endnext && in_b < b.endnext && *in_a++==*in_b++);
   if (in_a==a.endnext && in_b==b.endnext && *(--in_a) == *(--in_b)) return 1; else return 0;
 }
@@ -89,6 +95,8 @@
 pstring_gt(PSTRING a, PSTRING b) {
   const char* in_a=a.begin;
   const char* in_b=b.begin;
+  if (in_a==NULL) return 0;
+  if (in_b==NULL) return 1;
   while (in_a<a.endnext && in_b < b.endnext && *in_a++==*in_b++);
   if ((in_b==b.endnext && in_a!=a.endnext)
       || (*(--in_a) > *(--in_b)) ) return 1; else return 0;
@@ -99,6 +107,8 @@
 pstring_lt(PSTRING a, PSTRING b) {
   const char* in_a=a.begin;
   const char* in_b=b.begin;
+  if (in_b==NULL) return 0;
+  if (in_a==NULL) return 1;
   while (in_a<a.endnext && in_b < b.endnext && *in_a++==*in_b++);
   if ((in_b!=b.endnext && in_a==a.endnext)
       ||  *(--in_a) < *(--in_b) ) return 1; else return 0;
@@ -106,35 +116,48 @@
 
 static
 int 
-re_notlike(PSTRING a, PSTRING b) {
-  return ! re_like(a,b);
+re_notlike(struct expr_parser* exprobj, PSTRING a, PSTRING b) {
+  return ! re_like(exprobj, a,b);
 }
 
 #ifndef HAVE_PCRE
 static
 int 
-re_like(PSTRING a, PSTRING b) {
-    tmpl_log(TMPL_LOG_ERROR," (sorry, Stanislav Yadykin regexp extension is disabled at compile time) \n");
+re_like(struct expr_parser* exprobj, PSTRING a, PSTRING b) {
+  log_expr(exprobj,TMPL_LOG_ERROR,"can't parse the regular expression (sorry, Stanislav Yadykin regexp extension is disabled at compile time) \n");
   return 0;
 }
 #else
 #include <pcre.h>
 static
 int 
-re_like(PSTRING a, PSTRING b) {
+re_like(struct expr_parser* exprobj, PSTRING a, PSTRING b) {
   pcre* re;
   int ovector[30];
   int rc, erroffset;
   const char* error;
   const char* subject=a.begin;
   int subject_length=(int)(a.endnext-a.begin);
-  char* pattern=(char*)malloc(b.endnext-b.begin);
+  char* pattern;
+  if (subject==NULL) {
+    log_expr(exprobj,TMPL_LOG_INFO, "regular expression: applied to undefined value.\n");
+    return 0;
+  }
+  if (b.begin==NULL || (b.endnext-b.begin)==0) {
+    log_expr(exprobj,TMPL_LOG_INFO, "regular expression: the pattern is empty or undefined.\n");
+    return 1;
+  }
+  pattern=(char*)malloc(b.endnext-b.begin);
+  if (pattern==NULL) {
+    log_expr(exprobj,TMPL_LOG_ERROR, "regular expression: memory allocation failed.\n");
+    return 0;
+  }
   strncpy(pattern, b.begin, (b.endnext-b.begin));
   *(pattern+(b.endnext-b.begin))=0;
   re = pcre_compile(pattern, 0, &error, &erroffset, NULL); /* default character set */
   free(pattern);
   if (re==NULL) {
-    tmpl_log(TMPL_LOG_ERROR, "PCRE compilation failed at offset %d: %s\n",
+      log_expr(exprobj,TMPL_LOG_ERROR, "regular expression: PCRE compilation failed at offset %d: %s\n",
       erroffset, error);
     return 0;
   }

Modified: branches/upstream/libhtml-template-pro-perl/current/exprtool.h
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/exprtool.h?rev=59897&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/exprtool.h (original)
+++ branches/upstream/libhtml-template-pro-perl/current/exprtool.h Mon Jun 28 15:58:11 2010
@@ -51,6 +51,7 @@
 }; z.type=EXPR_TYPE_INT;
 
 #define DO_TXTOP(z,op,x,y,buf) expr_to_str(buf, &x,&y); z.type=EXPR_TYPE_INT; z.val.intval = op (x.val.strval,y.val.strval);
+#define DO_TXTOPLOG(z,op,x,y,exprobj) expr_to_str(exprobj->state, &x,&y); z.type=EXPR_TYPE_INT; z.val.intval = op (exprobj,x.val.strval,y.val.strval);
 
 static
 EXPR_char expr_to_int_or_dbl (struct expr_parser* exprobj, struct exprval* val1, struct exprval* val2);

Modified: branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm?rev=59897&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm (original)
+++ branches/upstream/libhtml-template-pro-perl/current/lib/HTML/Template/Pro.pm Mon Jun 28 15:58:11 2010
@@ -12,7 +12,7 @@
 use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
 @ISA = qw(DynaLoader Exporter);
 
-$VERSION = '0.9501';
+$VERSION = '0.9502';
 
 @EXPORT_OK = qw/ASK_NAME_DEFAULT ASK_NAME_AS_IS ASK_NAME_LOWERCASE ASK_NAME_UPPERCASE ASK_NAME_MASK/;
 %EXPORT_TAGS = (const => [qw/ASK_NAME_DEFAULT ASK_NAME_AS_IS ASK_NAME_LOWERCASE ASK_NAME_UPPERCASE ASK_NAME_MASK/]);

Modified: branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec?rev=59897&op=diff
==============================================================================
--- branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec (original)
+++ branches/upstream/libhtml-template-pro-perl/current/perl-HTML-Template-Pro.spec Mon Jun 28 15:58:11 2010
@@ -6,7 +6,7 @@
 %define module HTML-Template-Pro
 
 Name: perl-%module
-Version: 0.9501
+Version: 0.9502
 Release: alt1
 
 Packager: Igor Yu. Vlasenko <viy at altlinux.org>
@@ -54,6 +54,9 @@
 %perl_vendor_man3dir/*
 
 %changelog
+* Thu Jun 17 2010 Igor Vlasenko <viy at altlinux.ru> 0.9502-alt1
+- new version; see Changes
+
 * Wed Jun 09 2010 Igor Vlasenko <viy at altlinux.ru> 0.9501-alt1
 - new version; see Changes
 




More information about the Pkg-perl-cvs-commits mailing list