Skip to content

Commit b490469

Browse files
committed
> > On Fri, Dec 21, 2001 at 11:43:21AM +0800, Christopher Kings-Lynne
wrote: > > > Just testing pgcrypto on freebsd/alpha. I get some warnings: > > They should be harmless, although I should fix them. > > The actual code is: > > if ((dlen & 15) || (((unsigned) res) & 3)) > return -1; > Hard to imagine how (uint *) & 3 makes any sense, unless res isn't > always a (uint8 *). Is that true? At some point it was casted to (uint32*) so I wanted to be sure its ok. ATM its pointless. Please apply the following patch. -- marko
1 parent bc29b06 commit b490469

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

contrib/pgcrypto/internal.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: internal.c,v 1.10 2001/11/20 18:54:07 momjian Exp $
29+
* $Id: internal.c,v 1.11 2002/01/03 07:21:48 momjian Exp $
3030
*/
3131

3232

@@ -311,7 +311,7 @@ rj_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
311311
if (dlen == 0)
312312
return 0;
313313

314-
if ((dlen & 15) || (((unsigned) res) & 3))
314+
if (dlen & 15)
315315
return -1;
316316

317317
memcpy(res, data, dlen);
@@ -339,7 +339,7 @@ rj_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
339339
if (dlen == 0)
340340
return 0;
341341

342-
if ((dlen & 15) || (((unsigned) res) & 3))
342+
if (dlen & 15)
343343
return -1;
344344

345345
memcpy(res, data, dlen);
@@ -426,7 +426,7 @@ bf_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
426426
if (dlen == 0)
427427
return 0;
428428

429-
if ((dlen & 7) || (((unsigned) res) & 3))
429+
if (dlen & 7)
430430
return -1;
431431

432432
memcpy(res, data, dlen);
@@ -450,7 +450,7 @@ bf_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
450450
if (dlen == 0)
451451
return 0;
452452

453-
if ((dlen & 7) || (((unsigned) res) & 3))
453+
if (dlen & 7)
454454
return -1;
455455

456456
memcpy(res, data, dlen);

0 commit comments

Comments
 (0)