Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
entry->num_of_strings is a uint16_t. Casting it with
(int *)&entry->num_of_strings
is wrong, because it gives add_string_to_array the illusion that the object
"num" points to is an int, which it is not.
In case we are running on a machine where "int" is 32 or 64 bits long, what
happens with that cast? "add_string_to_array" interprets the byte field that
starts where "num_of_strings" starts as an int. Under very particular
circumstances this might work in a limited number of cases: When the byte order
of an int is such that the lower order bits of the int are stored first, the
subsequent bytes which do not belong to the uint16_t anymore happen to be 0 and
the result of the increment still fits into the first 2 bytes of that int, i.e.
the result is < 65536.
The correct solution to this problem is to use the implicit type conversion
that happens when an assignment is done.
BTW, this bug is found if you compile with -O3 -Wall, it shows up as a warning:
rpc_server/srv_eventlog_lib.c:574: warning: dereferencing type-punned pointer
will break strict-aliasing rules
Thanks,
Volker
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
This is almost a copy of write_eventlog_tdb() and still needs to be modified
to use tdb transactions.
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
entry->data_record.strings is type smb_ucs2, so the pointer arithmetic
increments by two :-)
|
|
Guenther
|
|
bad. Fixing... May fix bug #5891, not sure.
Jeremy.
|
|
|
|
(This used to be commit 7070c77ee2a9c3c9ff1b3c7b93008b13b80ac02b)
|
|
(This used to be commit cb6531965b2baab320123d4301ab851c6e22aa58)
|
|
(This used to be commit 252c3130697d1b7fd34a5225d83cef4f32e663b2)
|
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Jeremy,
I have never seen this warning before:
"warning: comparison is always false due to limited range of data type".
Guenther
- --
Günther Deschner GPG-ID: 8EE11688
Red Hat gdeschner@redhat.com
Samba Team gd@samba.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFHTIOOSOk3aI7hFogRArxMAJwP0ktE96tHcwn9nXG6AOqonpeDgQCgm/zi
54B6HJZvx6zdUTMFFNWqUb0=
=kUJa
-----END PGP SIGNATURE-----
>From 6a4935ee455adc1251fce2759f97d35f303bd40e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
Date: Tue, 27 Nov 2007 21:48:39 +0100
Subject: [PATCH] Getting rid of "comparison is always false due to limited range of data type"
warning.
Guenther
(This used to be commit 951202913956e113841585f7372e8db8f9aeb76a)
|
|
srv_spoolss_nt.c and srv_srvsvc_nt.c.
They're next :-).
Jeremy.
(This used to be commit 55b4f9d003b036af69085f7b64e0df08c5ba440d)
|
|
The point is doing the following associations:
- non discardable state data (all TDB files that may need to be backed
up) go to statedir
- shared data (codepage stuff) go to codepagedir
The patch *does not change* the default location for these
directories. So, there is no behaviour change when applying it.
The main change is for samba developers who have to think when dealing
with files that previously pertained to libdir whether they:
- go in statedir
- go in codepagedir
- stay in libdir
(This used to be commit d6cdbfd875bb2653e831d314726c3240beb0a96b)
|
|
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
|
|
(This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227)
|
|
Jeremy.
(This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
|
|
and fix all compiler warnings in the users
metze
(This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
|
|
(This used to be commit 1e4ee728df7eeafc1b4d533240acb032f73b4f5c)
|
|
Jeremy.
(This used to be commit cde8323fdc4d4ddaa30e8c59bec89dc130fe26a6)
|
|
BUILTIN\Administrators
(This used to be commit a02933c9589e34488f289cbc40f77f6864a58367)
|
|
does not
have the timeout argument in Samba4. Add a new routine
tdb_lock_bystring_with_timeout.
Volker
(This used to be commit b9c6e3f55602fa505859a4b2cd137b74105d685f)
|
|
* Fix parsing error in eventlogadm caused by log entries
with no DAT: line.
(This used to be commit f0a8f438793a806e8cf73e1e695b09e540a4239e)
|
|
This feature got broken in some of the other updates.
Now each open handle stores an pointer to an open tdb
data structure (not the tdb pointer itself).
Clearing can be done with a simple elog_close_tdb( elog, True )
to force a close and then calling elog_open_tdb( logname, True )
to force an tdb truncate. Permissions on existing tdbs are
maintained which is important.
* We don't currently handle backup. Haven't looked at the
format of a backuped up eventlog to know what the deal is.
(This used to be commit 2df34c9403446d12f1ceeac38cbda5d3ba805b02)
|
|
x86_64 box.
Jeremy.
(This used to be commit d720867a788c735e56d53d63265255830ec21208)
|
|
(This used to be commit 1bcf7e82ede63a851a244162a3b939373787b693)
|
|
* only keep the registry,tdb file open when we have an open key handle
* tpot's setup.py fix
* removing files that no longer exist in trunk and copying some
that were missing in 3.0
(This used to be commit 6c6bf6ca5fd430a7a20bf20ed08050328660e570)
|
|
Jeremy.
(This used to be commit 30bd894ee63e5be266b6069533138ccb3c0fbccb)
|
|
(This used to be commit f10aa9fb84bfac4f1a22b74d63999668700ffaac)
|