| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
| From: | =?iso-8859-15?Q?Rafael_Garc=EDa?= <rafael-no_spam_please_ AT geninfor DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: strange comparison error |
| Date: | Tue, 23 Mar 2004 10:23:03 +0100 |
| Organization: | Telefonica Data Espagna |
| Lines: | 18 |
| Message-ID: | <opr5a5opiiwfff31@news.mad.ttd.net> |
| References: | <opr49vxpzbwfff31 AT news DOT mad DOT ttd DOT net> <200403221712 DOT i2MHCeik004358 AT envy DOT delorie DOT com> |
| NNTP-Posting-Host: | 100.red-80-34-252.pooles.rima-tde.net |
| Mime-Version: | 1.0 |
| X-Trace: | nsnmrro2-gest.nuria.telefonica-data.net 1080033945 22834 80.34.252.100 (23 Mar 2004 09:25:45 GMT) |
| X-Complaints-To: | usenet AT nsnmrro2-gest DOT nuria DOT telefonica-data DOT net |
| NNTP-Posting-Date: | Tue, 23 Mar 2004 09:25:45 +0000 (UTC) |
| User-Agent: | Opera7.11/Win32 M2 build 2887 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
En Mon, 22 Mar 2004 12:12:40 -0500, DJ Delorie <dj AT delorie DOT com> escribió:
>
>> if (pcampo>reg+MAXFIELDS) { // intercept huge (bad) values
>
> If integer overflow is the culprit, you'll find this a bit safer:
>
> if (pcampo-reg > MAXFIELDS) { // intercept huge (bad) values
>
Sorry, I don't understand. Could you please explain a bit more?
We are using 32 bit numbers, the size of the struct is around 100 bytes. We
should go to thousands of t_field's to reach overflow. Right? I have 14
here.
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |