repeat() fix:
repeat() fix:

> Neil Conway <neilc@samurai.com> writes:
> > +   /* Check for integer overflow */
> > +   if (tlen / slen != count)
> > +           elog(ERROR, "Requested buffer is too large.");
>
> What about slen == 0?

Good point -- that wouldn't cause incorrect results or a security
problem, but it would reject input that we should really accept.

Revised patch is attached.

Neil Conway

ovr/postgres-xl,foyzur/gpdb,rvs/gpdb,xuegang/gpdb,zaksoup/gpdb,Quikling/gpdb,ahachete/gpdb,50wu/gpdb,snaga/postgres-xl,Quikling/gpdb,jmcatamney/gpdb,zaksoup/gpdb,lintzc/gpdb,adam8157/gpdb,arcivanov/postgres-xl,50wu/gpdb,xinzweb/gpdb,tangp3/gpdb,foyzur/gpdb,foyzur/gpdb,zaksoup/gpdb,royc1/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,yazun/postgres-xl,ashwinstar/gpdb,lpetrov-pivotal/gpdb,jmcatamney/gpdb,ovr/postgres-xl,atris/gpdb,lintzc/gpdb,lisakowen/gpdb,janebeckman/gpdb,techdragon/Postgres-XL,50wu/gpdb,0x0FFF/gpdb,ashwinstar/gpdb,lintzc/gpdb,chrishajas/gpdb,yuanzhao/gpdb,Quikling/gpdb,xuegang/gpdb,xuegang/gpdb,jmcatamney/gpdb,Postgres-XL/Postgres-XL,lintzc/gpdb,xinzweb/gpdb,chrishajas/gpdb,postmind-net/postgres-xl,lpetrov-pivotal/gpdb,snaga/postgres-xl,rvs/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,lintzc/gpdb,kaknikhil/gpdb,zeroae/postgres-xl,lpetrov-pivotal/gpdb,royc1/gpdb,janebeckman/gpdb,edespino/gpdb,yuanzhao/gpdb,postmind-net/postgres-xl,Quikling/gpdb,rubikloud/gpdb,pavanvd/postgres-xl,xuegang/gpdb,50wu/gpdb,lpetrov-pivotal/gpdb,xuegang/gpdb,royc1/gpdb,lisakowen/gpdb,xinzweb/gpdb,tpostgres-projects/tPostgres,yuanzhao/gpdb,oberstet/postgres-xl,pavanvd/postgres-xl,Chibin/gpdb,arcivanov/postgres-xl,Chibin/gpdb,adam8157/gpdb,rvs/gpdb,Postgres-XL/Postgres-XL,cjcjameson/gpdb,yazun/postgres-xl,ashwinstar/gpdb,pavanvd/postgres-xl,xinzweb/gpdb,CraigHarris/gpdb,0x0FFF/gpdb,Postgres-XL/Postgres-XL,oberstet/postgres-xl,kmjungersen/PostgresXL,Quikling/gpdb,janebeckman/gpdb,ovr/postgres-xl,adam8157/gpdb,Postgres-XL/Postgres-XL,randomtask1155/gpdb,CraigHarris/gpdb,atris/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,rubikloud/gpdb,greenplum-db/gpdb,arcivanov/postgres-xl,cjcjameson/gpdb,50wu/gpdb,lpetrov-pivotal/gpdb,lintzc/gpdb,adam8157/gpdb,postmind-net/postgres-xl,kaknikhil/gpdb,randomtask1155/gpdb,0x0FFF/gpdb,xuegang/gpdb,yazun/postgres-xl,lpetrov-pivotal/gpdb,CraigHarris/gpdb,xuegang/gpdb,tpostgres-projects/tPostgres,janebeckman/gpdb,ashwinstar/gpdb,50wu/gpdb,royc1/gpdb,oberstet/postgres-xl,rvs/gpdb,janebeckman/gpdb,janebeckman/gpdb,50wu/gpdb,lisakowen/gpdb,royc1/gpdb,tangp3/gpdb,rvs/gpdb,atris/gpdb,chrishajas/gpdb,tangp3/gpdb,kaknikhil/gpdb,snaga/postgres-xl,rvs/gpdb,0x0FFF/gpdb,Quikling/gpdb,tpostgres-projects/tPostgres,Chibin/gpdb,snaga/postgres-xl,yuanzhao/gpdb,lisakowen/gpdb,Chibin/gpdb,cjcjameson/gpdb,ahachete/gpdb,adam8157/gpdb,cjcjameson/gpdb,snaga/postgres-xl,kaknikhil/gpdb,atris/gpdb,pavanvd/postgres-xl,oberstet/postgres-xl,xinzweb/gpdb,foyzur/gpdb,arcivanov/postgres-xl,chrishajas/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,chrishajas/gpdb,royc1/gpdb,lintzc/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,lisakowen/gpdb,ashwinstar/gpdb,0x0FFF/gpdb,Quikling/gpdb,yazun/postgres-xl,rubikloud/gpdb,Chibin/gpdb,yuanzhao/gpdb,Quikling/gpdb,techdragon/Postgres-XL,atris/gpdb,50wu/gpdb,atris/gpdb,atris/gpdb,rvs/gpdb,randomtask1155/gpdb,adam8157/gpdb,zaksoup/gpdb,rvs/gpdb,jmcatamney/gpdb,lisakowen/gpdb,rvs/gpdb,edespino/gpdb,Chibin/gpdb,zaksoup/gpdb,postmind-net/postgres-xl,yuanzhao/gpdb,tangp3/gpdb,techdragon/Postgres-XL,ahachete/gpdb,edespino/gpdb,tpostgres-projects/tPostgres,xuegang/gpdb,0x0FFF/gpdb,rubikloud/gpdb,kmjungersen/PostgresXL,yazun/postgres-xl,tangp3/gpdb,zaksoup/gpdb,zeroae/postgres-xl,randomtask1155/gpdb,greenplum-db/gpdb,zeroae/postgres-xl,lintzc/gpdb,lisakowen/gpdb,pavanvd/postgres-xl,randomtask1155/gpdb,arcivanov/postgres-xl,xuegang/gpdb,edespino/gpdb,Chibin/gpdb,yuanzhao/gpdb,CraigHarris/gpdb,foyzur/gpdb,rvs/gpdb,janebeckman/gpdb,kaknikhil/gpdb,greenplum-db/gpdb,janebeckman/gpdb,foyzur/gpdb,edespino/gpdb,foyzur/gpdb,Chibin/gpdb,atris/gpdb,ahachete/gpdb,foyzur/gpdb,tpostgres-projects/tPostgres,kaknikhil/gpdb,janebeckman/gpdb,chrishajas/gpdb,greenplum-db/gpdb,zaksoup/gpdb,edespino/gpdb,edespino/gpdb,chrishajas/gpdb,0x0FFF/gpdb,ahachete/gpdb,ahachete/gpdb,xinzweb/gpdb,lpetrov-pivotal/gpdb,tangp3/gpdb,adam8157/gpdb,adam8157/gpdb,zeroae/postgres-xl,kaknikhil/gpdb,ahachete/gpdb,CraigHarris/gpdb,arcivanov/postgres-xl,xinzweb/gpdb,ovr/postgres-xl,jmcatamney/gpdb,0x0FFF/gpdb,kmjungersen/PostgresXL,cjcjameson/gpdb,rubikloud/gpdb,tangp3/gpdb,CraigHarris/gpdb,jmcatamney/gpdb,janebeckman/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,xinzweb/gpdb,royc1/gpdb,CraigHarris/gpdb,randomtask1155/gpdb,kmjungersen/PostgresXL,Quikling/gpdb,yuanzhao/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,lisakowen/gpdb,kaknikhil/gpdb,zaksoup/gpdb,lpetrov-pivotal/gpdb,ashwinstar/gpdb,edespino/gpdb,rubikloud/gpdb,oberstet/postgres-xl,kmjungersen/PostgresXL,zeroae/postgres-xl,Quikling/gpdb,edespino/gpdb,edespino/gpdb,CraigHarris/gpdb,randomtask1155/gpdb,ashwinstar/gpdb,Chibin/gpdb,techdragon/Postgres-XL,chrishajas/gpdb,ahachete/gpdb,Chibin/gpdb,rubikloud/gpdb,CraigHarris/gpdb,techdragon/Postgres-XL,ashwinstar/gpdb,rubikloud/gpdb,ovr/postgres-xl,randomtask1155/gpdb,greenplum-db/gpdb,lintzc/gpdb,postmind-net/postgres-xl,royc1/gpdb,tangp3/gpdb