OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Wietse Venema (wietseporcupine.org)
Date: Tue Apr 03 2001 - 09:10:23 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    This code skips all database replies that contain at least one
    empty field, pretending that the entries do not exist. Is this
    the desirable result, or should the empty field be given to the
    caller as an empty field?

            Wietse

    Laurent Wacrenier:
    > Hi,
    >
    > In the mysql dictionnary, the case where a field can be NULL is not
    > probed. This produce crash when a column value is NULL.
    >
    > You can reproduce the bug easily with postmap using a mysql map, setting
    > select_field = NULL
    > then query any existent key.
    >
    > The following fix make the dictionnary to return the key does not
    > exists at all when some row value is NULL. It applies on snapshot-20010329.
    >
    > --- src/util/dict_mysql.c.dist Tue Apr 3 15:08:45 2001
    > +++ src/util/dict_mysql.c Tue Apr 3 15:19:07 2001
    > -201,6 +201,12
    > if (i > 0)
    > vstring_strcat(result, ",");
    > for (j = 0; j < mysql_num_fields(query_res); j++) {
    > + if (row[j] == NULL) {
    > + if (msg_verbose > 1)
    > + msg_info("dict_mysql_lookup: retrieved field: %d: NULL", j);
    > + mysql_free_result(query_res);
    > + return NULL;
    > + }
    > if (j > 0)
    > vstring_strcat(result, ",");
    > vstring_strcat(result, row[j]);
    >
    >
    > -
    > To unsubscribe, send mail to majordomopostfix.org with content
    > (not subject): unsubscribe postfix-users
    >
    >

    -
    To unsubscribe, send mail to majordomopostfix.org with content
    (not subject): unsubscribe postfix-users