projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update NEWS
[yaz-moved-to-github.git]
/
src
/
ber_oid.c
diff --git
a/src/ber_oid.c
b/src/ber_oid.c
index
6a0541e
..
9a96e52
100644
(file)
--- a/
src/ber_oid.c
+++ b/
src/ber_oid.c
@@
-1,8
+1,6
@@
-/*
- * Copyright (C) 1995-2005, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2010 Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- *
- * $Id: ber_oid.c,v 1.7 2005-06-25 15:46:03 adam Exp $
*/
/**
*/
/**
@@
-59,6
+57,12
@@
int ber_oidc(ODR o, Odr_oid *p, int max_oid_size)
len--;
}
while (*(o->bp++) & 0X80);
len--;
}
while (*(o->bp++) & 0X80);
+
+ if (id < 0)
+ {
+ odr_seterror(o, ODATA, 23);
+ return 0;
+ }
if (pos > 0)
p[pos++] = id;
else
if (pos > 0)
p[pos++] = id;
else
@@
-75,6
+79,11
@@
int ber_oidc(ODR o, Odr_oid *p, int max_oid_size)
return 0;
}
}
return 0;
}
}
+ if (pos < 2 || p[0] < 0 || p[1] < 0)
+ {
+ odr_seterror(o, ODATA, 23);
+ return 0;
+ }
p[pos] = -1;
return 1;
case ODR_ENCODE:
p[pos] = -1;
return 1;
case ODR_ENCODE:
@@
-88,7
+97,7
@@
int ber_oidc(ODR o, Odr_oid *p, int max_oid_size)
odr_seterror(o, ODATA, 23);
return 0;
}
odr_seterror(o, ODATA, 23);
return 0;
}
- for (pos = 1; p[pos] >= 0; pos++)
+ for (pos = 1; p[pos] != -1; pos++)
{
n = 0;
if (pos == 1)
{
n = 0;
if (pos == 1)
@@
-127,6
+136,7
@@
int ber_oidc(ODR o, Odr_oid *p, int max_oid_size)
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab