similar to: Why p_strdup and other string functions uses loops instead strlen? (dovecot 2.0.rc4)

Displaying 20 results from an estimated 60 matches similar to: "Why p_strdup and other string functions uses loops instead strlen? (dovecot 2.0.rc4)"

2006 Nov 13
1
my_strncasecmp ignores max_chars
my_strncasecmp ignores the length parameter, which breaks all sorts of things on platforms where the function actually gets used. Trivial patch attached. -- Ben Winslow <rain at bluecherry.net> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: compat.c.diff URL:
2013 Oct 24
1
Problems with userdb lookup
Hello, since few days there are problems with the userdb lookup. The problem occur if the recipient user is unknown (here test at xtlv.cn) doveconf -n # 2.2.6 (f89e645cba90): /etc/dovecot/dovecot.conf # OS: Linux 3.2.45.stk32 i686 Debian jessie/sid ext3 auth_debug = yes auth_debug_passwords = yes auth_mechanisms = digest-md5 cram-md5 auth_username_translation = %Lu auth_verbose = yes
2006 Nov 02
0
ssh strlen fixes
The following diffs fix negative index array accesses. For the path_append diff, if the first path is empty the second path is just duplicated without a '/'. Is this correct? -Ray- Index: misc.c =================================================================== RCS file: /home/ray/openbsd/src/usr.bin/ssh/misc.c,v retrieving revision 1.64 diff -u -p -r1.64 misc.c --- misc.c 3 Aug 2006
2018 Apr 12
0
Missed memcpy & strlen/cat optimizations in LLVM
Hi, I found some cases which can be improved in LLVM optimizer: https://godbolt.org/g/g5y9Qf To summarize, folding memcpy calls could be interesting optimization to explore, but maybe not so trivially to implement. Memcpy + strlen case should be easy to implement, I think I would look on it. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL:
2018 Apr 20
2
Missed strlen optimizations
Hello, Code: https://godbolt.org/g/EG4Wi6 unsigned fff3(void) { char buf[10] = ""; return strlen(buf); } Since we are memset-ing before strlen call, we could replace strlen with just 0. Has LLVM any API to get "last instruction before strlen" which modifies strlen argument "buf"? So we can check "yes, it is memset there, replace strlen with zero"
2018 Apr 20
0
Missed strlen optimizations
Is: 2018-04-20 18:07 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>: > Hello, > > Code: https://godbolt.org/g/EG4Wi6 > > unsigned fff3(void) { > char buf[10] = ""; > return strlen(buf); > } > > Since we are memset-ing before strlen call, we could replace strlen with > just 0. > > Has LLVM any API to get "last
2018 Apr 20
0
Missed strlen optimizations
Maybe nicer.. auto i = Src->uses().begin(); std::advance(i, Src->getNumUses() - 1); i->getUser()->dump(); 2018-04-20 19:19 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>: > Use *last = nullptr; > for (Use &U : Src->uses()) > last = &U; > last->getUser()->dump(); > > > Or any better solution? > > 2018-04-20 19:19
2012 Jul 12
1
[patch 2/3 -next] tcm_vhost: strlen() doesn't count the terminator
We do snprintf() from "page" to a buffer with TCM_VHOST_NAMELEN characters so the current code will silently truncate the last character. Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index d217bed..57d39c5 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -1254,7 +1254,7 @@
2012 Jul 12
1
[patch 2/3 -next] tcm_vhost: strlen() doesn't count the terminator
We do snprintf() from "page" to a buffer with TCM_VHOST_NAMELEN characters so the current code will silently truncate the last character. Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index d217bed..57d39c5 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -1254,7 +1254,7 @@
2012 Jul 13
1
[patch -next] tcm_vhost: another strlen() off by one
strlen() doesn't count the NUL terminator. I missed this one in the patches I sent yesterday. Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 29850cb..ea72198 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -1424,7 +1424,7 @@ static struct se_wwn *tcm_vhost_make_tport(
2012 Jul 13
1
[patch -next] tcm_vhost: another strlen() off by one
strlen() doesn't count the NUL terminator. I missed this one in the patches I sent yesterday. Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com> diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 29850cb..ea72198 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c @@ -1424,7 +1424,7 @@ static struct se_wwn *tcm_vhost_make_tport(
2011 Jun 10
1
[PATCH libguestfs] build: include <string.h> for src/match.c's use of strlen
--- Hi Rich, Without this, I got a warning (or was it an error, maybe due to -Werror?) due to the use of strlen, at least on F15 with bleeding edge gcc. src/match.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/match.c b/src/match.c index c007885..869850c 100644 --- a/src/match.c +++ b/src/match.c @@ -20,6 +20,7 @@ #include <stdio.h> #include
2014 Jan 08
0
[PATCH 1/3] lib: Add internal function to calculate strlen for strings encoded in Latin1 or UTF-16LE
--- lib/hivex-internal.h | 1 + lib/utf16.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/hivex-internal.h b/lib/hivex-internal.h index 6bc8638..7f4cc3c 100644 --- a/lib/hivex-internal.h +++ b/lib/hivex-internal.h @@ -277,6 +277,7 @@ extern char * _hivex_recode (const char *input_encoding, _hivex_recode ("LATIN1", _input, _len, "UTF-8",
2018 Apr 20
2
Missed strlen optimizations
Use *last = nullptr; for (Use &U : Src->uses()) last = &U; last->getUser()->dump(); Or any better solution? 2018-04-20 19:19 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>: > Is: > > > 2018-04-20 18:07 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>: > >> Hello, >> >> Code: https://godbolt.org/g/EG4Wi6
2008 Jan 07
1
assertion with outlook
i saw two crashes in my syslog with dovecot, and google did not report any known problems. i have no problems using dovecot, thus bugreport is just for information. following information: ubuntu gutsy gibbon server amd64 ext3 outlook 2003 & 2007, just retrieving mails. mails have been migrated via imapsync 2 days before to this server. dovecot is imap-server and LDA. has been seen with
2008 Dec 10
2
assert with zlib and (maybe) fts
Hi, I compressed a folder with the following script: ... for i in *.*.*; do file $i | grep bzip2 >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "Compress: $i" cat "$i" | bzip2 -9 > ../tmp/$i if [ $? -eq 0 ]; then mv ../tmp/$i $i fi else
2007 Aug 16
3
imap killed with signal 6 (including backtrace)
Found this today multiple times for the same user: Aug 16 16:59:38 postamt dovecot: IMAP(username): file strfuncs.c: line 165 (p_strndup): assertion failed: (max_chars != (size_t)-1) Aug 16 16:59:38 postamt dovecot: IMAP(username): Raw backtrace: imap [0x80c6d53] -> imap(i_fatal+0) [0x80c6795] -> imap(p_strndup+0x38) [0x80d8316] -> imap(t_strndup+0x22) [0x80d86d7] ->
2016 Feb 07
3
[PATCH] strlen -> strnlen optimization
Joerg Sonnenberger wrote: > On Sat, Feb 06, 2016 at 11:05:14PM -0500, Michael McConville via llvm-dev wrote: > > This addition converts strlen() calls to strnlen() when the result is > > compared to a constant. For example, the following: > > > > strlen(s) < 5 > > > > Becomes: > > > > strnlen(s, 5) < 5 > > > > That way, we
2015 Jan 20
3
[LLVMdev] strlen in fast-isel
It seems that fast-isel for intel does not handle strlen. It's a general problem in fast-isel . ~/llvmw/build/Deb~/llvmw/build/Debug+Asserts/bin/clang -O0 -mllvm -fast-isel-verbose -mllvm -fast-isel strlen1.c strlen1.c:12:3: warning: implicitly declaring library function 'printf' with type 'int (const char *, ...)' printf("%i\n", len); ^
2016 Feb 07
3
[PATCH] strlen -> strnlen optimization
This addition converts strlen() calls to strnlen() when the result is compared to a constant. For example, the following: strlen(s) < 5 Becomes: strnlen(s, 5) < 5 That way, we don't have to walk through the entire string. There is the added overhead of maintaining a counter when using strnlen(), but I thought I'd start with the general case. It may make sense to only use this