summaryrefslogtreecommitdiff
path: root/lib/rpmlead.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-06-22 18:51:56 +0000
committerjbj <devnull@localhost>2002-06-22 18:51:56 +0000
commit05cb73a7ee762065339393057d421613866e0418 (patch)
tree533b7192c83e882aab90c337d4356735932de7f0 /lib/rpmlead.c
parentba41c1ccb13a7a27466470e501a0d4f30fddec40 (diff)
downloadlibrpm-tizen-05cb73a7ee762065339393057d421613866e0418.tar.gz
librpm-tizen-05cb73a7ee762065339393057d421613866e0418.tar.bz2
librpm-tizen-05cb73a7ee762065339393057d421613866e0418.zip
Factor bounds checking annotations into source code.
CVS patchset: 5521 CVS date: 2002/06/22 18:51:56
Diffstat (limited to 'lib/rpmlead.c')
-rw-r--r--lib/rpmlead.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rpmlead.c b/lib/rpmlead.c
index 032ffb484..23560ec16 100644
--- a/lib/rpmlead.c
+++ b/lib/rpmlead.c
@@ -21,7 +21,9 @@ int writeLead(FD_t fd, const struct rpmlead *lead)
{
struct rpmlead l;
+/*@-boundswrite@*/
memcpy(&l, lead, sizeof(*lead));
+/*@=boundswrite@*/
l.magic[0] = RPMLEAD_MAGIC0;
l.magic[1] = RPMLEAD_MAGIC1;
@@ -41,7 +43,9 @@ int writeLead(FD_t fd, const struct rpmlead *lead)
int readLead(FD_t fd, struct rpmlead *lead)
{
+/*@-boundswrite@*/
memset(lead, 0, sizeof(*lead));
+/*@=boundswrite@*/
/*@-type@*/ /* FIX: remove timed read */
if (timedRead(fd, (char *)lead, sizeof(*lead)) != sizeof(*lead)) {
rpmError(RPMERR_READ, _("read failed: %s (%d)\n"), Fstrerror(fd),