Path: blob/main/crypto/krb5/src/util/support/zap.c
34889 views
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/* util/support/zap.c */2/*3* Copyright 2009 Massachusetts Institute of Technology.4* All Rights Reserved.5*6* Export of this software from the United States of America may7* require a specific license from the United States Government.8* It is the responsibility of any person or organization contemplating9* export to obtain such a license before exporting.10*11* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and12* distribute this software and its documentation for any purpose and13* without fee is hereby granted, provided that the above copyright14* notice appear in all copies and that both that copyright notice and15* this permission notice appear in supporting documentation, and that16* the name of M.I.T. not be used in advertising or publicity pertaining17* to distribution of the software without specific, written prior18* permission. Furthermore if you modify this software you must label19* your software as modified software and not distribute it in such a20* fashion that it might be confused with the original M.I.T. software.21* M.I.T. makes no representations about the suitability of22* this software for any purpose. It is provided "as is" without express23* or implied warranty.24*/2526/*27* krb5int_zap() is used by zap() (a macro or static inline function defined in28* k5-platform.h) on non-Windows, non-gcc compilers, in order to prevent the29* compiler from inlining and optimizing out the memset() call.30*/3132#include <k5-platform.h>3334void krb5int_zap(void *ptr, size_t len)35{36volatile char *p = ptr;3738while (len--)39*p++ = '\0';40}414243