r13766: Patch from Arek Glabek <aglabek@centeris.com>:
authorGerald Carter <jerry@samba.org>
Wed, 1 Mar 2006 03:10:21 +0000 (03:10 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:10:53 +0000 (11:10 -0500)
* Fix parsing error in eventlogadm caused by log entries
  with no DAT: line.
(This used to be commit f0a8f438793a806e8cf73e1e695b09e540a4239e)

source3/rpc_server/srv_eventlog_lib.c

index ec5edf2f3478db77f1c2f0583b5165b4f7317dfd..b3d94901bacd595b929b5dd099b58742e91c5dd0 100644 (file)
@@ -707,16 +707,13 @@ BOOL parse_logentry( char *line, Eventlog_entry * entry, BOOL * eor )
                memset( temp, 0, sizeof( temp ) );
                strncpy( temp, stop, temp_len );
                rpcstr_push( ( void * ) ( entry->data_record.strings +
-                                         entry->data_record.strings_len ),
+                                         ( entry->data_record.strings_len / 2 ) ),
                             temp,
                             sizeof( entry->data_record.strings ) -
-                            entry->data_record.strings_len, STR_TERMINATE );
-               entry->data_record.strings_len += temp_len + 1;
+                            ( entry->data_record.strings_len / 2 ), STR_TERMINATE );
+               entry->data_record.strings_len += ( temp_len * 2 ) + 2;
                entry->record.num_strings++;
        } else if ( 0 == strncmp( start, "DAT", stop - start ) ) {
-               /* Now that we're done processing the STR data, adjust the length to account for
-                  unicode, then proceed with the DAT data. */
-               entry->data_record.strings_len *= 2;
                /* skip past initial ":" */
                stop++;
                /* now skip any other leading whitespace */