OSSP CVS Repository

ossp - Check-in [4306]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4306
Date: 2001-Aug-09 17:25:57 (local)
2001-Aug-09 15:25:57 (UTC)
User:simons
Branch:
Comment: The assert() in extended.c is wrong because it is not invariable but depends on "user input". Use "if" instead.
Tickets:
Inspections:
Files:
ossp-pkg/xds/docs/extended.c      1.1 -> 1.2     5 inserted, 1 deleted
ossp-pkg/xds/docs/libxds.tex      1.11 -> 1.12     6 inserted, 2 deleted

ossp-pkg/xds/docs/extended.c 1.1 -> 1.2

--- extended.c   2001/08/08 13:13:11     1.1
+++ extended.c   2001/08/09 15:25:57     1.2
@@ -35,7 +35,11 @@
                     &tmp, &i);
     if (rc == XDS_OK)
         {
-        assert(i == sizeof(ms->text));
+        if (i != sizeof(ms->text))
+            {
+            free(tmp);
+            return XDS_ERR_TYPE_MISMATCH;
+            }
         memmove(ms->text, tmp, i);
         free(tmp);
         }


ossp-pkg/xds/docs/libxds.tex 1.11 -> 1.12

--- libxds.tex   2001/08/09 15:23:28     1.11
+++ libxds.tex   2001/08/09 15:25:57     1.12
@@ -1,6 +1,6 @@
 % -*- mode: LaTeX; fill-column: 75; -*-
 %
-% $Id: libxds.tex,v 1.11 2001/08/09 15:23:28 simons Exp $
+% $Id: libxds.tex,v 1.12 2001/08/09 15:25:57 simons Exp $
 %
 \documentclass[a4paper,10pt,pointlessnumbers,bibtotoc]{scrartcl}
 \usepackage[dvips,xdvi]{graphicx}
@@ -709,7 +709,11 @@
                     &tmp, &i);
     if (rc == XDS_OK)
         {
-        assert(i == sizeof(ms->text));
+        if (i != sizeof(ms->text))
+            {
+            free(tmp);
+            return XDS_ERR_TYPE_MISMATCH;
+            }
         memmove(ms->text, tmp, i);
         free(tmp);
         }

CVSTrac 2.0.1